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 8730203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:58:19+00:00 2026-06-13T08:58:19+00:00

In my application, I have a screen which has a menu on action bar

  • 0

In my application, I have a screen which has a menu on action bar on tap of which I show sub-menus which I need to put at runtime depending on the status of a process running in background.

e.g. Suppose, I am on screen SCREEN and my menu is MENU which has three sub-menus

MENU---->  1. SubMenu1
           2. SubMenu2
           3. SubMenu3

If a process PROCESS running in background is finished I want to display menus SubMenu1 and Submenu2 otherwise I’ll put only SubMenu3 excluding SubMenu1 & SubMenu2.

I can take this decision in onCreateOptionsMenu(Menu menu) method but if the user is on the SCREEN and the PROCESS completes, SubMenu3 should be shown instead of the previously shown SubMenus.

I believe this can be done (as Play Store app adds “My Apps” menu at runtime).
How can I achieve this?

  • 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-13T08:58:20+00:00Added an answer on June 13, 2026 at 8:58 am

    You can implement onCreateOptionsMenu(Menu) and create the options menu there based on the current state.

    Whenever that state changes you can call invalidateOptionsMenu() to indicate that the options menu needs to be recreated. This will recreate the menu and again call onCreateOptionsMenu(Menu) as described in http://developer.android.com/reference/android/app/Activity.html#invalidateOptionsMenu%28%29

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

Sidebar

Related Questions

I have a .net application which includes search screen which has a panel with
I have a simple graphics application which draws some stuff on the screen. Before,
In my application I have several activities, the main screen has 4 buttons that
I have an application which has two Activities, let's call them A and B.
I have a web application with a backing bean which has the context of
i have an android application which has a listview for listing 14 items inside
In my application, I have few screen coordinates through which I draw a Bezier
I have an application which has a layout similar to iTunes. The main window
I have an application that has 2 screens. The first screen has a ListView
I have an application that contains a main Activity, which has a very simple

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.