[mono-android] how to access an activity from broadcast receiver
Jonathan Pobst
monkey at jpobst.com
Sun Feb 19 20:23:56 UTC 2012
Try:
Java.Lang.Class.FromType (typeof (Activity1))
Jonathan
On 2/19/2012 1:50 PM, tweaver60 wrote:
> I'm sure this is a beginner question, please bear with me:
>
> I'm trying to create an intent inside a broadcast receiver for an activity -
> can't seem to figure out how to access the class (does not compile), as they
> do in a sample Java app I'm looking at
>
> // Create an Intent to launch ExampleActivity
> Intent intent = new Intent(context,* Activity1*); //Java
> accesses as *Activity1.class*
> PendingIntent pendingIntent =
> PendingIntent.GetActivity(context, 0, intent, 0);
>
> I've tried appname.Activity1 which also does not compile. Activity1 comes
> up in intellisense, but throws an error.
>
> Thanks for any help,
>
> Tim
>
>
>
>
> --
> View this message in context: http://mono-for-android.1047100.n5.nabble.com/how-to-access-an-activity-from-broadcast-receiver-tp5497414p5497414.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
More information about the Monodroid
mailing list