[android-developers] Re: Update view of installed apps without reloading
An update:
I tried to copy my code from my tab activity to the main tab host
activity, but I'm confused as to where to declare the list and the
adapters. Currently I generate the app list in the ListActivity as a
Runnable in onCreate(), which calls another Runnable to generate the
array adapter as another Runnable to populate the view. If I move this
all to the main tab host, what should I do in the ListActivity to
filter the list?
I've tried creating a separate list in the ListActivity's onCreate()
that copies a subset of the main app list, and then declaring a new
adapter that uses this smaller list instead. However, this doesn't
work since the main app list is always empty when the ListActivity
tries to access it since it's not created yet.
On Jan 6, 2:49 pm, galapogos <gois...@gmail.com> wrote:
> On Jan 5, 9:49 pm, TreKing <treking...@gmail.com> wrote:
>
> > On Wed, Jan 4, 2012 at 8:06 PM, galapogos <gois...@gmail.com> wrote:
> > > 1. getInstalledPackages seem to take quite a bit of time to detect and
> > > display all apps(about 8-10s for 200+ apps). Is it possible to make
> > > this faster? Titanium Backup seems to list all apps instantaneously
> > > when I tap the "Backup/Restore" tab. Android system's own "Manage
> > > Applications" also seems to be much quicker at displaying the apps.
>
> > Caching.
>
> How do I cache? I did some investigation, and the steps that seem to
> take a lot of time is displaying of the app name/icon and whether it's
> a system app or not, i.e. getting the following results:
> 1. applicationInfo.loadLabel().toString()
> 2. applicationInfo.flags
> 3. applicationInfo.loadIcon()
>
> How do I cache when it's the first time that I'm running the app and
> it's generating a new list?
>
>
>
> > > 2. Like "Manage Applications", I would like to have a way to cull the
> > > list so that I can in various tabs I can display apps based on their
> > > properties, e.g. system vs user app, launchable vs non-launchable,
> > > etc. I know how to do this via the applicationInfo.flags, but how do I
> > > do this without running getInstalledPackages in the tab activity and
> > > incurring the detection phase all over again? How can I pass the List
> > > from 1 tab to another?
>
> > The Tabs should be part of the same Activity, which would have one list
> > they both access.
>
> I see. Currently I have a main activity which extends a TabActivity
> class, and in it I have a few tabs, which extends ListActivity
> classes. So I should generate the app list in the TabActivity's
> onCreate() method, and access the list from the tabs?
>
> Thanks again.
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home