I tried accessing Main_Activity.this, but Eclipse says:
No enclosing instance of the type Main_Activity is accessible in scope. I don't know why it won't let me do it. On Mar 12, 11:44 am, Carlos Silva <[email protected]> wrote: > "this" on a class that extends Activity isn't simple enough? > > > > > > > > On Mon, Mar 12, 2012 at 17:39, bob <[email protected]> wrote: > > Why is there no static function like Activity.getCurrentActivity()? > > > Right now, I am saving the Activity in a static variable in onCreate > > so I can access it easily later on. I suspect there must be a better > > way. > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

