I Use ShareActionProvider in PopupMenu, but show two PopupMenu?

允我心安 提交于 2019-12-04 05:19:10

I had to use startActivity(getShareIntent("/status.jpg")); This doesn't work exactly as you expect. However, it can be used for the same purpose. Hope it help.

private Intent getShareIntent(String filePath) {
        Intent shareIntent = new Intent(Intent.ACTION_SEND);

        File sdCard = Environment.getExternalStorageDirectory();

        File sharedFile = new File(sdCard + sharePath);
        Uri uri = Uri.fromFile(sharedFile);

        shareIntent.setType("image/*");
        shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
        return shareIntent;
    }

However, finally I moved to use action bar with Selection patten instead: http://developer.android.com/design/patterns/selection.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!