سؤال

I need to update my menu. I have a fragment which is created from activity. In that activity, I have an asynchronous method which fetches an object.

It is based on this method that I need to update the menu. At all time, I'm using fragments, I am using onPrepareOptionsMenu method but its not working. This is because when onPrepareOptionsMenu is first called, the object is not yet fetched from the server.

I'm trying to use invalidateMenuOption but i'm getting "Call requires API level 11 (current min is 8): android.app.Activity#invalidateOptionsMenu". When I set the API Level to 11, invalidateMenuOption does the job

Is there any turnaround for API Level 8

هل كانت مفيدة؟

المحلول

Better use Android Support library and then try this. Sure it will work.

http://developer.android.com/tools/support-library/setup.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top