Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8067713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:24:53+00:00 2026-06-05T12:24:53+00:00

I’m developing a weather app, but I have a problem when displaying an optionsMenu

  • 0

I’m developing a weather app, but I have a problem when displaying an optionsMenu with some smartphones. I want to display a menu with 3 options, but on the HTC one X, only 2 options are displayed.

The problem is that the black bar at the bottom of the screen hides the third option of my menu.

Here is a screenshot of the problem : (we should see “Recharger”, “Voir cette image” and the last option : “Autres cartes”)

enter image description here

The code :

    public boolean onCreateOptionsMenu(Menu menu) {
    menu.add(0,100,0,m_res.getStringArray(R.array.menu_reload)[Commons.currentLanguage]).setIcon(R.drawable.reload); 
    menu.add(0,101,0,m_res.getStringArray(R.array.menu_view_single)[Commons.currentLanguage]).setIcon(R.drawable.see); 
    if(m_model.getUrl2().size() !=0)
        menu.add(0,102,0,m_res.getStringArray(R.array.menu_more)[Commons.currentLanguage]).setIcon(R.drawable.more); 
    SubMenu moreMaps = menu.addSubMenu(0,103,0,m_res.getStringArray(R.array.menu_others_maps)[Commons.currentLanguage]).setIcon(R.drawable.france); 
    if(m_time == 1)
    {
        for(int iBoucle = 0 ; iBoucle < m_model.getNames1().size() ; iBoucle++)
            moreMaps.add(1,iBoucle,1,m_model.getNames1().get(iBoucle));
    }
    else
    {
        for(int iBoucle = 0 ; iBoucle < m_model.getNames2().size() ; iBoucle++)
            moreMaps.add(1,iBoucle,1,m_model.getNames2().get(iBoucle));
    }
    onContextItemSelected(moreMaps.getItem());
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case 100:
        if(Commons.getNetworkState() || Commons.getWifiState())
        {
            eraseData();
            loadingData();
        }
        else
            Commons.getConnectivityErrorMessage(m_Context);
        return true;
    case 101:
        Intent sia  = new Intent(m_Context, SingleImageActivity.class);
        sia.putExtra("url", correctURL(m_urlImages.get(m_step)));
        sia.putExtra("choiceNumber", -1);
        if(m_textIsHour)
        {
            if(m_time == 1)
                sia.putExtra("title", m_model.getNames1().get(m_mode)+" - "+m_model.getHours1().get(m_step)+"h");
            else
                sia.putExtra("title", m_model.getNames2().get(m_mode)+" - "+m_model.getHours2().get(m_step)+"h");
        }
        startActivity(sia);
        break;
    case 102:
        if(Commons.getNetworkState() || Commons.getWifiState())
        {
            Intent modelSubList = new Intent(m_Context, ModelViewActivity.class);
            modelSubList.putExtra("model",m_modelNumber);
            modelSubList.putExtra("mode",m_mode);
            if(m_time == 1)
                modelSubList.putExtra("time",2);

            else
                modelSubList.putExtra("time",1);
            startActivity(modelSubList);
            finish();
        }
        else
        {                   
            Commons.getConnectivityErrorMessage(m_Context);
        }
        break;
    case 103:
        break;
    default:
        if(Commons.getNetworkState() || Commons.getWifiState())
        {
            Intent otherMapsIntent  = new Intent(m_Context, ModelViewActivity.class);
            otherMapsIntent.putExtra("model",m_modelNumber);
            otherMapsIntent.putExtra("mode",item.getItemId());
            otherMapsIntent.putExtra("time",m_time);
            startActivity(otherMapsIntent);
            finish();
            return true;
        }
        else
        {                   
            Commons.getConnectivityErrorMessage(m_Context);
            return false;
        }

    }

    return false;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:24:55+00:00Added an answer on June 5, 2026 at 12:24 pm

    This code is showing three menu options on the US and European One X phones I have here:
    https://github.com/lnanek/Misc/tree/master/OneXFullscreenMenuTest

    Can you try it on your device? If it doesn’t work, then we know it is the software on your device. If it does work, then it could be something in your code.

    Can you post more about your situation? I’m particularly interested in the code for how you turn on fullscreen and your AndroidManifest.xml (for things like the uses-sdk line and theme settings).

    I don’t see anything wrong offhand in the code you posted, but could you comment out this line just for a quick check?
    if(m_model.getUrl2().size() !=0)

    If that check isn’t passing, then there should be only two menu items, not three. So commenting it out would be a quick check (or watching in a debugger to see if all three adds are called, of course).

    Please note that onCreateOptionsMenu is only called the very first time the Activity instance shows the options menu, as opposed to onPrepareOptionsMenu which is called every time. So if adding that third menu option is not done the very first time, then it never will be.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
i want to parse a xhtml file and display in UITableView. what is the
I want to construct a data frame in an Rcpp function, but when I
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.