0
我很難弄清楚這裏有什麼問題。我得到了它與這個意圖過濾器的活動:Uri.parse和Uri.Builder給出相同的uri但不同的結果
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="launcher"
android:host="custo"
/>
</intent-filter>
我成功地做(路徑和參數在代碼進一步處理)推出我的活動:
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("launcher://custo/3dw?iuid=06eec76c-f48e-4961-870e-4b27495f8201"));
但是這一次不工作:
Uri uri = new Uri.Builder().scheme("launcher").appendEncodedPath("/custo").appendPath("3dw").appendQueryParameter("iuid", "f6f18a3d-14f9-4969-8a24-8130f4cad5d1").build();
context.startActivity(new Intent(Intent.ACTION_VIEW, uri);
錯誤是:
無法用意圖「act = ... action.VIEW dat =」啓動器:// custo/3dw?iuid = 06eec76c-f48e-4961-870e-4b27495f8201「(與我解析的字符串相同)啓動活動。
怎麼了?
就是這樣,非常感謝。 – ValPar