This is not currently supported.  We weren't using it anywhere in the UI on
the G1, so we turned it off to avoid wasting time/space.

On Wed, Jan 21, 2009 at 6:46 AM, drasticp <drast...@gmail.com> wrote:

>
> I'd like to get some thumbnail images of the running applications. The
> combination of RunningTaskInfo.thumbnail and
> Activity.onCreateThumbnail seems like just the thing but I don't see
> it working. I've overridden onCreateThumbnail in my main Activity.
> According to the documentation, this method is called by the framework
> when the activity is paused. I've set a breakpoint in the method and
> it never seems to be hit. The base implementation of onCreateThumbnail
> would work just fine if it would fire.
>
> @Override
> public boolean onCreateThumbnail(Bitmap outBitmap, Canvas canvas)
> {
>        return super.onCreateThumbnail(outBitmap, canvas);
> }
>
> Also, I've written some simple code to getRunningTasks from the
> ActivityManager. The RunningTaskInfo.thumbnail property is always
> null. Is there something I need to set within an application so that
> it will generate it's thumbnail before onPause? Is something needed in
> the manifest. The documentation on this feature is sparse.
>
> Here's some [simplified] code I use in an extension of BaseAdapter  to
> fetch the running tasks:
>
> ActivityManager manager = (ActivityManager)context.getSystemService
> (Context.ACTIVITY_SERVICE);
> List<RunningTaskInfo> tasks = manager.getRunningTasks(10);
> RunningTaskInfo info = tasks.get(arg0);
> LayoutInflater inflater = (LayoutInflater)context.getSystemService
> (Context.LAYOUT_INFLATER_SERVICE);
> View view = inflater.inflate(R.layout.taskitem, null);
> ImageView image = (ImageView)view.findViewById(R.id.image);
> TextView label = (TextView)view.findViewById(R.id.label);
> label.setText(info.baseActivity.getPackageName());
> Bitmap bmp = info.thumbnail;
> image.setImageBitmap(bmp);
>
>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to