Hi, I am trying to retrieve all applications that are running on the
android phone. Following is the code I have wrote, but how do I get
the application name into my Array items? Please advise. Thanks.

        Context context = getApplicationContext();
        Resources appR = context.getResources();

        ActivityManager actmgr=(ActivityManager)context.getSystemService
(Context.ACTIVITY_SERVICE);
        List<RunningAppProcessInfo> appList =
actmgr.getRunningAppProcesses();

        CharSequence[] items = new CharSequence[appList.size()];
        Vector <Process>allProcesses = new Vector <Process>();

        for (int i=0;i<appList.size();i++) {
                RunningAppProcessInfo rti = (RunningAppProcessInfo)appList.get
(i);
                Process p = new Process (rti.pid,rti.processName,rti.pkgList);
                allProcesses.add(p);
                items[i] = p.getProcessName();
        }
:
:
:

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to