【发布时间】:2018-05-17 06:47:23
【问题描述】:
下面是代码;
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + finalFile.getAbsolutePath()));
shareIntent.setPackage("com.instagram.android");
startActivityForResult(Intent.createChooser(shareIntent, "Share your Photo"),INSTA);
而onActivityResult以下是不行的;
if (requestCode==INSTA)
{
if (resultCode == Activity.RESULT_OK) {
// Here you do what you have to do.
Toast.makeText(getApplicationContext(),"share successful...",Toast.LENGTH_LONG).show();
}else
{
Toast.makeText(getApplicationContext(),"share unsuccessful...",Toast.LENGTH_LONG).show();
}
}
【问题讨论】:
标签: android instagram instagram-api