how to get menu handler

by sjia » Tue, 16 Dec 2008 06:28:18 GMT

Sponsored Links
 I'd like to disable a menu item in void onCreate(Bundle
savedInstanceState).  Is there a system call to get the menu handler?


how to get menu handler

by Dmaxi » Wed, 17 Dec 2008 07:19:48 GMT

 You can get the Options Menu instance for your activity from
onCreateOptionsMenu(Menu) method which is called only once when it is
initialized or from onPrepareOptionsMenu(Menu) method which is called
every time the menu button pressed.
See #onCreateOptionsMenu(android.view.Menu)
and #onPrepareOptionsMenu(android.view.Menu)


Sponsored Links

Other Threads

1. SDCard mounted read-only for one app but not for the other?

Hi all,

I have an application which can write/read files on SDcard. Every time
I launch the emulator, I run: emulator -sdcard sdcard.
It's working fine.

But, I have another application where I'd like to read files wrote by
the first one. But this particular application, after
getExternalStorageDir() method, says that sdcard is empty...I mounted
it, checked, the files of the first application are still present. So
I ran some more tests and I saw this. In the second app:
File f = Environment.getExternalStorageDir();
f.canRead() = FALSE; ??
f.canWrite() = FALSE; ??

why? I do not get it...Why is the first application able to read/write
on the SD and not the other? I use the exact same method on both of
them, so this is crazy...

PS: If that helps, second application is a service.

Best Regards,



2. 鈥淔ailed to find provider info 鈥? when Adding Recent Query Suggestions

Hi, I am trying to implement recent Query Suggestions into my app, but
got stuck in a ailed to find provider info error
please give some help

code as below:


<searchable xmlns:android=""
    android:searchSuggestSelection=" ?"

// content provider class

package testing.advancedsearch;

import android.content.SearchRecentSuggestionsProvider;

public class MySuggestionProvider extends
SearchRecentSuggestionsProvider {
    public final static String AUTHORITY =
    public final static int MODE = DATABASE_MODE_QUERIES;

    public MySuggestionProvider() {
        setupSuggestions(AUTHORITY, MODE);

// manifest.xml

<provider android:name=".MySuggestionProvider"
android:authorities="testing.advancedsearch.mysuggestionprovider" />



3. wifi - Autoconnect to networks without password

4. SDCard, file exists for one application but not for the other?

5. Fullscreen IME does not show ExtractEditText

6. Camera shutter sound is turned off after few picture takes

7. calling android activity