freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

android高手進階-資料下載頁

2025-08-04 22:27本頁面
  

【正文】 nds Activity {      @Override     public void onCreate(Bundle savedInstanceState) {          (savedInstanceState)?!         etContentView()?!                 @Override     public boolean onCreateOptionsMenu(Menu menu) {       MenuInflater inflater = getMenuInflater()。       (, menu)。        return true?!                 @Override     public boolean onOptionsItemSelected(MenuItem item) {       switch (()) {    case :          break?!   ase :     break?!   ase :     break?!   ase :     showSettings()?!    reak?!          return (item)?!                       private void showSettings(){              final Intent settings = new Intent()?!          ? |                   )?!                 tartActivity(settings)。     }  }     四、運行代碼之,點擊模擬器上的menu 按鈕將會出現(xiàn)上述效果圖!  Ok~今天就到這里,祝大家周末愉快!!!!  出處Android高手進階教程(七)之 Android 中Preferences的使用!大家好,我們這一節(jié)講的是Android Preferences 的學習,Preferences 在Android當中被用來記錄應用,以及用戶喜好等等,它可以用來保存  簡單的數(shù)據(jù)類型,如Int,Double,Boolean等。Preferences中保存的數(shù)據(jù)可以理解為Map型。我們通過 PreferenceManager 以及getDefaultSharedPreferences(Context) 來獲取它,比如當我們想獲得整數(shù)我們可以用 getInt(String key, int defVal) .獲取里面的某個鍵值,當我們想修改時候我們用 putInt(String key, int newVal), 最后用 edit(), 方法提交!千萬不要忘記了哦~  為了讓大家跟好的理解我做了一個簡單的Demo,程序主要有個TextView控件,上面寫著用戶使用改應用的次數(shù)。效果如下圖所示:  下面是實現(xiàn)Demo的大體步驟:  一、新建一個Android工程命名為:PreferencesDemo?! 《?、:?xml version= encoding=utf8?     LinearLayout xmlns:android=        android:orientation=vertical        android:layout_width=fill_parent        android:layout_height=fill_parent             TextView           android:id=@+id/text        android:layout_width=fill_parent          android:layout_height=wrap_content          android:text=@string/hello        /     /LinearLayout    ?xml version= encoding=utf8? LinearLayout xmlns:android=     android:orientation=vertical     android:layout_width=fill_parent     android:layout_height=fill_parent      TextView        android:id=@+id/text     android:layout_width=fill_parent       android:layout_height=wrap_content       android:text=@string/hello     / /LinearLayout  三、全部代碼如下:package ?!    mport ?!    mport 。     import 。     import 。     import ?!    ublic class PreferencesDemo extends Activity {         /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {             (savedInstanceState)?!            etContentView()?!                                      haredPreferences mPerferences = PreferenceManager             .getDefaultSharedPreferences(this)?!                         nt counter = (counter, 0)?!                         extView mTextView = (TextView)findViewById()?!                         ?This app has been started  + counter +  times.)?!                          Editor = ()?!                         ?counter, ++counter)?!            ?)?!                          }    package ?! mport ?! mport ?! mport ?! mport ?! mport ?! ublic class PreferencesDemo extends Activity {      /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {          (savedInstanceState)?!         etContentView()?!                             haredPreferences mPerferences = PreferenceManager          .getDefaultSharedPreferences(this)。                    int counter = (counter, 0)。                    TextView mTextView = (TextView)findViewById()。                    (This app has been started  + counter +  times.)?!                    Editor = ()?!                   ?counter, ++counter)?!         ?)?!                 }     四、運行代碼,實現(xiàn)上述效果.  五、查看Preferences文件,首先打開命令終端:adb shell一下,然后cd data/data進入該目錄,ls一下我們會發(fā)現(xiàn)一大堆包文件,入下圖所示:  cd (這里是我程序的包名) /shared_prefs,:  ,格式如下(為什么這樣大家自己去理解):?xml version=39。39?!ncoding=39。utf839?!tandalone=39。yes39?!?   map   int name=counter value=3 /   /map  ?xml version=39。39。 encoding=39。utf839?!tandalone=39。yes39。 ?mapint name=counter value=3 //map  OK,今天就到此為止,以上全是個人愚見,如果有什么地方不對的,請指正,謝謝大家!  出處Android高手進階教程(八)之 Android Widget開發(fā)案例今天我們要寫一下Android Widget的開發(fā),由于快點凌晨,我就不說的太具體了,同志們就模仿吧!首先看一下效果圖:  下面是Demo的詳細步驟:  一、新建一個Android工程命名為:WidgetDemo.  二、準備素材,一個是Widget的圖標,一個是Widget的背景。存放目錄如下圖:  三、:?xml version= encoding=utf8?     resources         string name=helloHello World, WidetDemo!/string         string name=app_nameDaysToWorldCup/string     /resources    ?xml version= encoding=utf8? resources     string name=helloHello World, WidetDemo!/string     string name=app_nameDaysToWorldCup/string /resources   四、建立Widget內容提供者文件,我們在res下建立xml文件夾,:?xml version= encoding=utf8?     appwidgetprovider xmlns:android=        android:minWidth=50dip        android:minHeight=50dip        android:updatePeriodMillis=10000        android:initialLayout=@layout/main    /     ?xml version= encoding=utf8? appwidgetprovider xmlns:android=  android:minWidth=50dip  android:minHeight=50dip  android:updatePeriodMillis=10000  android:initialLayout=@layout/main /    五、代碼如下:?xml version= encoding=utf8?     LinearLayout xmlns:android=        android:orientation=vertical        android:layout_width=fill_parent        android:layout_height=fill_parent        android:background=@drawable/wordcup             TextView           android:id=@+id/wordcup        android:layout_width=fill_parent          android:layout_height=wrap_content          android:text=@string/hello        android:textSize=12px        android:textColor=ff0000        /     /LinearLayout   
點擊復制文檔內容
環(huán)評公示相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1