问题描述
Android如何获取到正在运行Activity的缩略图,RunningTaskInfo的thumbnail属性获取总是为空,求解! public void getAppProcesses(){ taskPics = new ArrayList<Drawable>(); ActivityManager actManager = (ActivityManager)this.getSystemService(Activity.ACTIVITY_SERVICE); List<RunningTaskInfo> runningApp = actManager.getRunningTasks(10); PackageManager pm = TaskDemActivity.this.getPackageManager(); for(RunningTaskInfo tempApp : runningApp){ String pkgName=tempApp.baseActivity.getPackageName(); if(tempApp.thumbnail == null){ taskPics.add(getResources().getDrawable(R.drawable.icon)); }else{ taskPics.add(new BitmapDrawable(tempApp.thumbnail)); } System.out.println("tempApp.thumbnail=="+tempApp.thumbnail); } } 问题补充:嗯,好象是这样!谢谢!Rainbow702 写道
解决方案
http://www.bangchui.org/read.php?tid=12612&page=1
解决方案二:
所以,你最好去查看一下 android.app.ActivityThread.java ,看你用的android版本中的这个类,是否仍然未实现这个特性。
解决方案三:
:? 还像得修改 framework了
解决方案四:
下面这个贴子来自于Android官方论坛:http://groups.google.com/group/android-developers/browse_thread/thread/279b81b47ce11bc1,里面有一句:引用This is not currently supported. We weren't using it anywhere in the UI onthe G1, so we turned it off to avoid wasting time/space. 和引用There is just an if statement in android.app.ActivityThread.java that has itcurrently turned off.