Code example for PackageManager

Methods: getInstalledPackages

0
        public void onPreExecute() { 
            setProgressBarIndeterminateVisibility(true);
        } 
        @Override 
        public Void doInBackground(Void... params) {
            groups = mPackageManager.getInstalledPackages(0);
            Collections.sort(groups, new PackageInfoComparable());
            return null; 
        } 
        @Override 
        public void onPostExecute(Void result) {
            setProgressBarIndeterminateVisibility(false);
            setListAdapter(new MyExpandableListAdapter(groups));
        } 
    } 
 
    @Override 
    protected void onCreate(Bundle savedState) {
        super.onCreate(savedState);
        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        setContentView(R.layout.activity_list);