Hi All,

I have managed to list down all the installed packages. I have used
ArrayList and ArrayAdapter to list down the installed packages.

Now if a user click on any one of it I want to start the respective
activity. How do I go about doing it?

Because to use an intent to start the activity I need both the package
name and class name. Eg.

Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.alarmclock",
"com.android.alarmclock.AlarmClock"));
startActivity(intent);

How do I get the class name? Is there any other way that upon clicking
can start that particular activity?

Regards,
Perumal

On Mar 24, 10:45 am, perumal316 <perumal...@gmail.com> wrote:
> Thanks Murali,
>
> It is working now. But it is displaying a whole chunk of data. I want
> to display just the Activity Class and package name.
>
> Any idea how to do it? Am I correct to use getInstalledPackages() or
> is there any other methods I can use to get the Activity Class and the
> corresponding package name.
>
> Thanks In Advance,
> Perumal
>
> On Mar 24, 10:36 am, murali raju <manutd...@gmail.com> wrote:
>
> > PackageManager pack = getPackageManager();
>
> > On Wed, Mar 24, 2010 at 7:32 AM, perumal316 <perumal...@gmail.com> wrote:
> > > Hi,
>
> > > I want to display all the installed packages to user. Below is the
> > > code snippet I used but not sure why it is not working.
>
> > >         int flags=0;
> > >        PackageManager pack = null;
> > >        List<PackageInfo> packInfo= pack.getInstalledPackages(flags);
> > >        CharSequence[] items = new CharSequence[packInfo.size()];
>
> > >        Vector <Process>allProcesses = new Vector <Process>();
> > >        for (int i=0;i<packInfo.size();i++)
> > >        {
> > >                String packI = "Packages"+packInfo;
> > >                Toast.makeText(this, packI, Toast.LENGTH_LONG).show();
>
> > >        }
>
> > > I just to display the entire list of packages to user. Any idea what's
> > > the problem with the above code?
>
> > > Thanks In Advance,
> > > Perumal
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > > To unsubscribe from this group, send email to android-developers+
> > > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > > ME" as the subject.

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to