隨筆-348  評論-598  文章-0  trackbacks-0
          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 閱讀(838) 評論(0)  編輯  收藏 所屬分類: Android
          主站蜘蛛池模板: 龙江县| 清水县| 夏津县| 陆川县| 达孜县| 阜新市| 灵宝市| 吉安市| 福泉市| 哈巴河县| 白城市| 广州市| 新密市| 石泉县| 香港 | 西乌珠穆沁旗| 思南县| 胶南市| 浏阳市| 于田县| 化德县| 伊春市| 柳林县| 繁昌县| 西盟| 屏山县| 保康县| 灵寿县| 万源市| 乌拉特中旗| 麻阳| 禹城市| 秀山| 凉城县| 安陆市| 麟游县| 西藏| 双江| 永济市| 密云县| 军事|