6
我用ShareActionProvider在PopupMenu的,但是當我點擊共享菜單項,它顯示在屏幕上的兩個PopupMenus,一個被另一個所覆蓋。和一個顯示應用程序圖標和名稱,另一種只顯示應用程序的名稱。我使用ShareActionProvider在PopupMenu的,但顯示兩個PopupMenu的?
它工作正常,除了這個問題...
我該如何解決它?
PS:請原諒我的不好表達
我的代碼是:
PopupMenu popup = new PopupMenu(this, button);
popup.getMenuInflater().inflate(R.menu.scrawl_popup_menu, popup.getMenu());
MenuItem overflowItem = popup.getMenu().findItem(R.id.popup_share);
ShareActionProvider overflowProvider =
(ShareActionProvider) overflowItem.getActionProvider();
overflowProvider.setShareHistoryFileName(
ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
overflowProvider.setShareIntent(createShareIntent());
menu.xml文件是:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/popup_clear"
android:icon="@drawable/ic_menu_clear"
android:title="@string/popup_menu_clear" />
<item android:id="@+id/popup_insert_bg"
android:icon="@drawable/ic_menu_insert_bg"
android:title="@string/popup_menu_insert_bg"/>
<item android:id="@+id/popup_share"
android:icon="@android:drawable/ic_menu_share"
android:title="@string/popup_menu_share"
android:actionProviderClass="android.widget.ShareActionProvider">
</item>
</menu>
完全離奇的問題,有關於它在這裏多的問題,絕對沒有答案!嘿! – Fattie 2014-06-06 09:19:54