This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Inflating menu closes application  RSS feed

 
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.



 
Saloon Keeper
Posts: 5133
135
  • 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.
 
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
     
    Now I am super curious what sports would be like if we allowed drugs and tiny ads.
    RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
    https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!