0
我試圖與Facebook,Twitter,Google +,Pinterest共享圖像。 我使用了以下代碼:Android共享意圖錯誤,如果應用程序不存在
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "Some Text");
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(android.os.Environment.getExternalStorageDirectory(),"Share/share.jpg")));
intent.setType("image/jpeg");
intent.setPackage("com.twitter.android");
startActivity(intent);
它的工作原理。但是如果twitter應用不存在我的手機,它會給出錯誤。當我得到錯誤時,如何與瀏覽器共享圖像和文本?
您更好地使用其提供的SDK的.. –