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

  • Home
  • SEARCH
  • 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 8821605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:53:49+00:00 2026-06-14T05:53:49+00:00

Back with another one. Trying to get what little app I have to cooperate

  • 0

Back with another one. Trying to get what little app I have to cooperate with 3.0+ Android versions, and have something i’m not sure how to handle..

I have an options menu, which I upgraded to better suit the Action bar, defined as:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:titleCondensed="@string/menu_sheet_photo_comp" android:title="@string/menu_sheet_photo" android:id="@+id/mnuCamera" android:icon="@android:drawable/ic_menu_camera" android:showAsAction="ifRoom" />
    <item android:titleCondensed="@string/menu_sheet_notes_comp" android:title="@string/menu_sheet_notes" android:id="@+id/mnuLogText" android:icon="@drawable/ic_menu_compose" />
    <item android:titleCondensed="@string/menu_sheet_track_comp" android:title="@string/menu_sheet_track" android:id="@+id/mnuTrack" android:icon="@android:drawable/ic_menu_compass" />
    <item android:titleCondensed="@string/menu_sheet_geocache_comp" android:title="@string/menu_sheet_geocache" android:id="@+id/mnuGC" android:icon="@drawable/ic_menu_emoticons" android:showAsAction="ifRoom" />

This all works fine as is – when the activity is run, the photo (first one) is displayed on the action bar on my phone, none of othe others are. Now, the options availability depend on a few things.

So, at the beginning of the Activity launch, a thread is sent off to get web data. And onCreateOptionsMenu() I disable the first item. (They cannot take a photo of it until we get web data back verifying it can be photographed.)

On previous versions of my app, it was easy – on onPrepareOptionsMenu() I check the status, and then enable or disable the options, as appropriate. Now, here’s what I can’t figure out how to do –

Since the camera button’s on the action bar, and not in the overflow menu, when the user taps it, onPrepareOptionsMenu() is never called, so the button stays disabled.

So how would I be able to make that button enabled once my background thread returns and I know that I can enable it?

Cheers –
Mike.

  • 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-14T05:53:51+00:00Added an answer on June 14, 2026 at 5:53 am

    Either call invalidateOptionsMenu() and add a check in onCreateOptionsMenu() for the enabling/disabling or create the menus programmatically and hold the Menu instance somewhere, so you can enable it later.

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

Sidebar

Related Questions

Back-end: I have a model (User) that has_many of another model (ContactPreference). Front-end: An
I am trying to use a sendOrderedBroadcast in my Android app. I want to
Complete rails newbie trying to get started. I have two classes, Ingredient, and Unit.
I'm trying to get a handle on using git. I've been using it on
I've been trying to get the text of items in listview another process. I
I'm trying to launch Internet Explorer as another user from our WPF app, so
I am trying to develope an action and I can not get this efect:
I have a table in a database with one column containing dates and another
I'm trying to get the following Google Apps script to work, taken from another
I'm trying to get crawl to work on two separate farms I have but

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.