Monday,April 25,2011-Eclipse_android_ApiDemo_学习3
Kardos
posted @ 2011年4月24日 14:56
in 未分类
, 1169 阅读
10.App/Activity/Redirection
app--Activity--redirection:演示如何修改永久保存的值,即SharedPreference和com.example. com.example.Android.apis.app.RedirectEnter
preferences.edit().remove("text").commit();//清除"text"键对应的值
11.App/Activity/Reorder Activities
有两种改变同一个Task中不同activity位置的方式,一为在manifest中设置activity的taskAffinity等属性。这里使用的是第二中,是用addFlags方法。
Intent intent = new Intent(ReorderFour.this, ReorderTwo.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
12.App/Activity/Save & Restore State
app-Activity--Save & Restore State:不知道想实现什么,看不懂
13.App/Activity/SetWallpaper
获取当前背景
final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
final Drawable wallpaperDrawable = wallpaperManager.getDrawable();
final ImageView imageView = (ImageView) findViewById(R.id.imageview);
imageView.setDrawingCacheEnabled(true);
imageView.setImageDrawable(wallpaperDrawable);