No Activity found to handle Intent 如何解决?

2025-03-04 15:00:19
推荐回答(1个)
回答1:

android.ndroid有两种Intent, 显式和隐式content.ActivityNotFoundException:NoActivityfoundtohandleIntent

每一个通过startActivity()方法发出的隐式Intent都至少有一个category,就是 "android.intent.category.DEFAULT",所以只要是想接收一个隐式Intent的Activity都应该包括"android.intent.category.DEFAULT" category,不然将导致 Intent 匹配失败

Intent-Filter的定义属性设置的例子

]]>

But I'm always getting "No activity found to handle Intent error":No Activity found to handle Intent { act=android.intent.action.VIEW dat=/storage/sdcard0/testStorage/updates/1.1.apk typ=application/vnd.adnroid.package-archive flg=0x10000000}

AddedFile setupFile = new File(args[0].getAsString());

alert("Is exists?", Boolean.toString(setupFile .exists())); //output as true

Said that file is real and args[0] path is