PackageManager无法识别内部inten-filter

时间:2019-07-01 14:24:51

标签: android android-intent android-manifest android-library intentfilter

我有一个触发意图的android应用。 它依赖于在其androidManifest中定义了一个intent过滤器的android lib来捕获此意图。

 <application>
    <activity
        android:name="myCode.InternalDummyActivity"
        android:exported="false">
      <intent-filter>
        <action android:name="myIntent.action"/>
        <category android:name="android.intent.category.DEFAULT"/>
      </intent-filter>
    </activity>
  </application>
  

一个应用触发意图,并定义处理活动   在android库中

但是,在Android应用程序代码中,packageManager无法识别可以处理此意图的应用程序。

  Intent intent = new Intent();
 intent.setAction("myIntent.action");

...

List<ResolveInfo> resolveInfos = getPackageManager().queryIntentActivities(intent,0);

resolveInfos有0个项目。

我想念什么?

我尝试过android:exported = truefalse

0 个答案:

没有答案
相关问题