Hmm, in my program FartKoll I start activities using new intent within the
startactivity. And there it works like a charm, how come?

On Aug 12, 2009 5:43 PM, "Mark Murphy" <mmur...@commonsware.com> wrote:

tinyang wrote: > I'm getting the error: > > The constructor Intent(new
View.OnClickListener(){}, ...
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 sub...

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to