开发安卓文管,分享给其他APP总是收不到!
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, Uri.fromFile(new File(path)));
intent.setType("*/*");
startActivity(Intent.createChooser(intent, "分享 " + title));
最后终于找到问题了:URI虽然显示为字符串,但它不是字符串,而是数据流!
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(path)));
intent.setType("*/*");
startActivity(Intent.createChooser(intent, "分享 " + title));