Changeset View
Changeset View
Standalone View
Standalone View
src/com/google/zxing/integration/android/IntentIntegrator.java
Show First 20 Lines • Show All 341 Lines • ▼ Show 20 Lines | protected void startActivityForResult(Intent intent, int code) { | ||||
fragment.startActivityForResult(intent, code); | fragment.startActivityForResult(intent, code); | ||||
} | } | ||||
} | } | ||||
private String findTargetAppPackage(Intent intent) { | private String findTargetAppPackage(Intent intent) { | ||||
PackageManager pm = activity.getPackageManager(); | PackageManager pm = activity.getPackageManager(); | ||||
List<ResolveInfo> availableApps = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); | List<ResolveInfo> availableApps = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); | ||||
if (availableApps != null) { | if (availableApps != null) { | ||||
Log.d("IntentIntegrator","Available app to scan QR Code: "+availableApps); | |||||
for (String targetApp : targetApplications) { | for (String targetApp : targetApplications) { | ||||
if (contains(availableApps, targetApp)) { | if (contains(availableApps, targetApp)) { | ||||
return targetApp; | return targetApp; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register