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?
Thanks

--~--~---------~--~----~------------~-------~--~----~



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 
 http://code.google.com/intl/en-EN/android/reference/android/app/Activity.html #onCreateOptionsMenu(android.view.Menu)
and 
 http://code.google.com/intl/en-EN/android/reference/android/app/Activity.html #onPrepareOptionsMenu(android.view.Menu)

Robert
--~--~---------~--~----~------------~-------~--~----~


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,

Guillaume

-- 

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.xml

<searchable xmlns:android="http://schemas.android.com/apk/res/android"
 
android:searchSuggestAuthority="testing.advancedsearch.mysuggestionprovider"
    android:searchSuggestSelection=" ?"
</searchable>

----------------------------------------------------------------------------------------------------------------
// content provider class

package testing.advancedsearch;

import android.content.SearchRecentSuggestionsProvider;

public class MySuggestionProvider extends
SearchRecentSuggestionsProvider {
    public final static String AUTHORITY =
"testing.advancedsearch.mysuggestionprovider";
    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