【发布时间】:2014-01-22 03:46:50
【问题描述】:
我的问题是当我当时使用分享事件时,我的第一个活动被关闭了
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
MenuItem shareItem = (MenuItem) menu.findItem(R.id.action_share);
ShareActionProvider mShare = (ShareActionProvider)shareItem.getActionProvider();
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("text/plain");`enter code here`
String Scategory_id = global.getcategoryid();
}
<item
android:id="@+id/action_share"
android:orderInCategory="100"
android:showAsAction="ifRoom"
android:actionProviderClass="android.widget.ShareActionProvider"/>
以上代码适用于菜单。 XML 和我在使用共享意图时遇到问题我的主要应用程序在使用共享按钮后实际关闭它应该在我的第一个应用程序上重定向
【问题讨论】:
标签: android android-intent share