do i have to modify the android manifest file as well to add the activity? On Thu, Jul 15, 2010 at 4:55 PM, Mark Murphy <[email protected]>wrote:
> On Thu, Jul 15, 2010 at 5:41 PM, Raul Martinez <[email protected]> wrote: > > i have a question can someone explain the syntax and fields of an Intent, > i > > have this code but the area highlighted in red is underlined in red and > says > > this: "No enclosing instance of the type Category is accessible in scope" > > what am i doing wrong? > > Intent intent = new Intent(Category.this.getApplication(), > > Category.class); > > startActivity(intent); > > Two issues: > > 1. Delete .getApplication() -- you don't need or want it here. > > 2. If this code is not in the Category class, then Category.this > cannot work. If just "this" is insufficient, then the class reference > needs to be whatever Context class this code is in, such as the name > of the activity. > > http://en.wikibooks.org/wiki/Java_Programming/Nested_Classes > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 3.1 Available! > > -- > You received this message because you are subscribed to the Google > Groups "Android Beginners" group. > > NEW! Try asking and tagging your question on Stack Overflow at > http://stackoverflow.com/questions/tagged/android > > To unsubscribe from this group, send email to > [email protected]<android-beginners%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

