0

I want share button in action bar only for one activity.

 <item android:id="@+id/menu_share"
    android:title="Share"
    android:showAsAction="ifRoom"
    android:actionProviderClass="android.widget.ShareActionProvider" />

The above code displays it in all the activities. How can i disable it in other activities? can somebody help me?

user305774
  • 123
  • 15

1 Answers1

0

I'm guessing that you are implementing onCreateOptionsMenu in each of you activities.

You should remove this method call from the activities that you do not want this menu option to be shown.

Damian
  • 8,062
  • 4
  • 42
  • 43