class MyApp extends Application {
private String myState;
public String getState(){
return myState;
}
public void setState(String s){
myState = s;
}
}
class Blah extends Activity {
@Override
public void onCreate(Bundle b){
MyApp appState = ((MyApp)getApplicationContext());
String state = appState.getState();
}
}
<application android:name=".MyApp"
android:icon="@drawable/icon"
android:label="@string/app_name">
---------------------------------------------------------
专注移动开发
Android, Windows Mobile, iPhone, J2ME, BlackBerry, Symbian
posted on 2011-01-21 14:12
TiGERTiAN 阅读(824)
评论(0) 编辑 收藏 所属分类:
Android