summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-06-24 20:29:21 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-06-24 20:29:21 -0700
commit83b8678dd4cc78dc89fe853161bd470ef28561c8 (patch)
tree3909c7de8441383eb482708acad0167e2bb882ec /core/java/android
parentc7410f6f9f8f2aeb9368502a4a725b1a7abe1190 (diff)
parent2bacbdfb519b2bfe8d4baca88da64e0f3b686e19 (diff)
downloadframeworks_base-83b8678dd4cc78dc89fe853161bd470ef28561c8.zip
frameworks_base-83b8678dd4cc78dc89fe853161bd470ef28561c8.tar.gz
frameworks_base-83b8678dd4cc78dc89fe853161bd470ef28561c8.tar.bz2
Merge change 5319 into donut
* changes: Add new APIs to LauncherActivity to be used elsewhere.
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/LauncherActivity.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/core/java/android/app/LauncherActivity.java b/core/java/android/app/LauncherActivity.java
index 8d249da..accdda9 100644
--- a/core/java/android/app/LauncherActivity.java
+++ b/core/java/android/app/LauncherActivity.java
@@ -60,26 +60,20 @@ public abstract class LauncherActivity extends ListActivity {
* An item in the list
*/
public static class ListItem {
+ public ResolveInfo resolveInfo;
public CharSequence label;
- //public CharSequence description;
public Drawable icon;
public String packageName;
public String className;
public Bundle extras;
ListItem(PackageManager pm, ResolveInfo resolveInfo, IconResizer resizer) {
+ this.resolveInfo = resolveInfo;
label = resolveInfo.loadLabel(pm);
if (label == null && resolveInfo.activityInfo != null) {
label = resolveInfo.activityInfo.name;
}
- /*
- if (resolveInfo.activityInfo != null &&
- resolveInfo.activityInfo.applicationInfo != null) {
- description = resolveInfo.activityInfo.applicationInfo.loadDescription(pm);
- }
- */
-
icon = resizer.createIconThumbnail(resolveInfo.loadIcon(pm));
packageName = resolveInfo.activityInfo.applicationInfo.packageName;
className = resolveInfo.activityInfo.name;
@@ -122,6 +116,14 @@ public abstract class LauncherActivity extends ListActivity {
return intent;
}
+ public ListItem itemForPosition(int position) {
+ if (mActivitiesList == null) {
+ return null;
+ }
+
+ return mActivitiesList.get(position);
+ }
+
public int getCount() {
return mActivitiesList != null ? mActivitiesList.size() : 0;
}
@@ -354,6 +356,16 @@ public abstract class LauncherActivity extends ListActivity {
}
/**
+ * Return the {@link ListItem} for a specific position in our
+ * {@link android.widget.ListView}.
+ * @param position The item to return
+ */
+ protected ListItem itemForPosition(int position) {
+ ActivityAdapter adapter = (ActivityAdapter) mAdapter;
+ return adapter.itemForPosition(position);
+ }
+
+ /**
* Get the base intent to use when running
* {@link PackageManager#queryIntentActivities(Intent, int)}.
*/