tinyang wrote: > I'm getting the error: > > The constructor Intent(new View.OnClickListener(){}, Class<SubActivity>) > is undefined > > On this line in my code: > > startActivity(*_new_*___ Intent(*this*, SubActivity.*class*)_); > > But I was advised that since I am trying to start a subactivity with > this line, I should not need to put an intent construct in the > manifest? Can someone please help me understand the problem? Thanks.
This is a Java question. You are presumably calling new Intent() from an inner class. Hence, "this" represents the instance of the inner class. To reference the "this" for an outer class, scope it: new Intent(MyActivityName.this, SubActivity.class) -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---