Here the following code snippet used to retrieve the installed package in your device
ListView programsList;
PackageManager mPackageManager;
programsList = (ListView) findViewById(R.id.ListView01);
programsList.setTextFilterEnabled(true);
mPackageManager = getPackageManager();
List<String> packageName = new ArrayList<String>();
List<ResolveInfo> list = mPackageManager.queryIntentActivities(
new Intent(Intent.ACTION_MAIN), 0);
for (ResolveInfo r : list) {
packageName.add(r.loadLabel(mPackageManager).toString());
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line,
packageName);
programsList.setAdapter(adapter);
ListView programsList;
PackageManager mPackageManager;
programsList = (ListView) findViewById(R.id.ListView01);
programsList.setTextFilterEnabled(true);
mPackageManager = getPackageManager();
List<String> packageName = new ArrayList<String>();
List<ResolveInfo> list = mPackageManager.queryIntentActivities(
new Intent(Intent.ACTION_MAIN), 0);
for (ResolveInfo r : list) {
packageName.add(r.loadLabel(mPackageManager).toString());
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line,
packageName);
programsList.setAdapter(adapter);
Thank you! This is what I need to find. Hope to hear more news from you.먹튀검증커뮤니티
ReplyDelete