保存全局变量在appliation不管activty的转换
public class MyApplication extends Application {
private String someVariable;
public String getSomeVariable() {
return someVariable;
}
public void setSomeVariable(String someVariable) {
this.someVariable = someVariable;
}
}
<application android:name="MyApplication" android:icon="@drawable/icon" android:label="@string/app_name">
// set
((MyApplication) this.getApplication()).setSomeVariable("foo");
// get
String s = ((MyApplication) this.getApplication()).getSomeVariable();
posted on 2010-08-26 19:39
MEYE 阅读(162)
评论(0) 编辑 收藏 所属分类:
Android3D