0
我們有一個應用程序,我們在Android上將圖像附加到MMS上,並且我們已經在Galaxy S4和S6上對其進行了測試,但客戶正在測試它的Xperia Z3緊湊,特別是遇到的意圖問題,爲圖像添加...找不到處理意圖的活動(MMS on Sony Xperia)
,我們從他身上發現了以下錯誤:
Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=image/png flg=0x10000001 pkg=com.android.mms (has clip) (has extras) }
因此,這是我們的方式添加圖片:
Intent picMessageIntent = new Intent(Intent.ACTION_SEND); picMessageIntent.setPackage("com.android.mms");
picMessageIntent.putExtra(Intent.EXTRA_STREAM, fileUri);
picMessageIntent.setType("image/png");
picMessageIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(picMessageIntent);
在我們的清單中,我們有:
uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
uses-permission android:name="android.permission.INTERNET"
我們與嘗試:
Intent chooser = Intent.createChooser(picMessageIntent, getResources().getText(R.string.intent_chooser));
chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(chooser);
但是,這只是給沒有有效的活動可以爲行動中發現的錯誤...怪異的一部分是,客戶正在消息應用程序中對其進行測試,並且我們想要使用消息應用程序......那麼,有些Android手機可以訪問它嗎?