Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inflating menu closes application  RSS feed

 
Bucky Bunny
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a little different kinda problem. When I run my autogenerated helloworld code, it works everything fine, but as soon as I inflate a menu file in the onCreateOptionsMenu() method, the app blinks for a while and gets closed.



 
Tim Moores
Saloon Keeper
Posts: 3511
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the app closes, then there should be something in the logcat. Post the stack trace here, it should give you starting points on what's going wrong.
 
Stephen M Davies
Greenhorn
Posts: 11
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I reproduced your code, and it runs with no problems. A few things to double check.


  • Check your resource layout file names are all correct, and that they are correctly written (no missing or malformed XML for example)


  • Check you have included your MainActivity in your manifest with the correct intent filter and activity name.


  • Check your API version you are using, in particular, your themes. Sometimes this can be problematic, Even if you are using the AppCompat libraries


  • However, it is important, as Tim Says, you need to post the Log, then we can see what's happening
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!