Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inflating menu closes application

 
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
Bartender
Posts: 3135
50
  • 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