当前位置: 代码迷 >> Android >> 高难度有关问题,activity在设置了priority后通过queryIntentActivities无法查询到其他同类intent
  详细解决方案

高难度有关问题,activity在设置了priority后通过queryIntentActivities无法查询到其他同类intent

热度:30   发布时间:2016-04-28 05:27:18.0
高难度问题,activity在设置了priority后通过queryIntentActivities无法查询到其他同类intent
在android中本来通过queryIntentActivities是能够查询到所有能打开某类型文件的intent,比如:
Uri uri = Uri.parse("geo:31.230416,121.473701"); Intent
                     intent = new Intent(Intent.ACTION_VIEW, uri);
                     List<ResolveInfo> list =
                     getPackageManager().queryIntentActivities(intent,
                     PackageManager.MATCH_DEFAULT_ONLY); Log.w(TAG,
                     "map list : "+list);

以上能返回许多同类型应用。
但是其中一个intent的priority被设置成1000后:
<activity
            。。。
            <!-- common filter -->
            <intent-filter android:priority="1000" >
          。。。
            </intent-filter>
。。。
再通过queryIntentActivities查询就只能够查询到以上一个程序了,请问这种情况该如何处理?

------解决方案--------------------
根据优先级查询我也没做过,也没看过api里面提过,可以这样查么
------解决方案--------------------
It also includes a "priority" value which is used to order multiple matching filters
你的priority的值是不是过大了?再去看看官网吧
  相关解决方案