• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Inflating menu closes application

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.



 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 11
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
     
    The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
    The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
    https://www.kickstarter.com/projects/paulwheaton/low-tech
    reply
      Bookmark Topic Watch Topic
    • New Topic