This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Application { | |
| private String mName; | |
| private String mPackage; | |
| private Drawable mIcon; | |
| private boolean isChecked; | |
| public boolean isChecked() { | |
| return isChecked; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private List<Application> getInstalledAppList() { | |
| List<Application> listApps = new ArrayList<>(); | |
| final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); | |
| mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); | |
| final List pkgAppsList = getPackageManager().queryIntentActivities(mainIntent, 0); | |
| // Them vao list | |
| for (Object object : pkgAppsList) { | |
| ResolveInfo info = (ResolveInfo) object; | |
| Drawable icon = getBaseContext().getPackageManager().getApplicationIcon(info.activityInfo.applicationInfo); | |
| String strPackageName = info.activityInfo.applicationInfo.packageName.toString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private List<Application> getInstalledAppList() { | |
| List<Application> listApps = new ArrayList<>(); | |
| final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); | |
| mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); | |
| final List pkgAppsList = getPackageManager().queryIntentActivities(mainIntent, 0); | |
| ResolveInfoComparator resolveInfoComparator = new ResolveInfoComparator(getPackageManager()); | |
| Collections.sort(pkgAppsList, resolveInfoComparator); | |
| String[] listPackageChecked = SharedPref.getInstance(getBaseContext()).getString(Constants.LIST_APP, "").split(getApplicationContext() | |
| .getString(R.string.signal)); | |
| for (Object object : pkgAppsList) { |
NewerOlder