-
生命周期查看全部
-
Activity體系查看全部
-
橫豎屏在切換時(shí),在onSavedInstance 方法中去保存數(shù)據(jù),然后在oncreate方法中去去判斷bundle不為空,用里面的數(shù)據(jù)來(lái)做初始化。查看全部
-
橫豎屏?xí)ractivity會(huì)被銷(xiāo)毀重新重建一個(gè)新的activity查看全部
-
在當(dāng)前activity a打開(kāi)另一個(gè)activity b時(shí),為何要先執(zhí)行當(dāng)前ade onpause方法?——假如a在放視頻,有聲音的,不onpause的話(huà),b起來(lái)了還是會(huì)有聲音的。查看全部
-
intent文檔查看全部
-
電話(huà),權(quán)限1呢,如果不是調(diào)用系統(tǒng)撥號(hào)查看全部
-
啟動(dòng)系統(tǒng)瀏覽器查看全部
-
配置兩個(gè)參數(shù),隱試意圖查看全部
-
6基本方法查看全部
-
我們使用匿名啟動(dòng)的時(shí)候,主要的原因是為了啟動(dòng)系統(tǒng)中的Activity查看全部
-
匿名啟動(dòng)的解釋: 1.在配置文件中的Activity中: <intent-filter> <action android:name="idcbgp.cn" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> 其中的intent-filter是必須先設(shè)置的標(biāo)簽,其中的action標(biāo)簽中的name的值是我們?cè)谔D(zhuǎn)的時(shí)候需要使用到的值,而其中的category標(biāo)簽中的name是我們系統(tǒng)默認(rèn)的,我們只需要這樣寫(xiě)好就好了 2.在代碼中實(shí)現(xiàn)的時(shí)候: Intent intent=new Intent(); intent.setAction("idcbgp.cn");//這就是我們?cè)谂渲梦募信渲玫腶ction中的name的值,直接在這里寫(xiě)好就是了 startActivity(intent);//直接使用這個(gè)方法就可以實(shí)現(xiàn)activity之間的跳轉(zhuǎn)查看全部
-
啟動(dòng)Activity的幾種方法: 1.直接啟動(dòng): 方法1: Intent intent=new Intent(this,SecondActivity.class); startActivity(intent); 方法2: Intent intent = new Intent(); ComponentName comonent = new ComponentName(ThreeActivity.this,FourActivity.class); intent.setComponent(comonent); startActivity(intent); 2. 匿名啟動(dòng): 1.首先在配置文件中,為那個(gè)需要跳轉(zhuǎn)到的那個(gè)Activity設(shè)置屬性 <activity android:name="com.wuyonghu.activitydemo1.FourActivity" android:label="@string/app_name" > <intent-filter> <action android:name="idcbgp.cn" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> 2.在代碼中去實(shí)現(xiàn): Intent intent = new Intent(); intent.setAction("idcbgp.cn"); startActivity(intent);查看全部
-
onDestory方法的使用: 例如,我們上面制作了一個(gè)播放音樂(lè)的方法,那么我們就需要在onDestory的方法中去釋放其中的資源: if(mediaPlayer!=null){ mediaPlayer.release(); mediaPlayer=null; }查看全部
-
在android中如何實(shí)現(xiàn)音樂(lè)的播放: 1.初始化:private MediaPlayer mediaPlayer; 2.mediaPlayer = MediaPlayer.create(SecondActivity.this,R.raw.music);//這里我們是將res文件夾下面的raw文件夾中的一個(gè)名為music.mp3的音樂(lè) 3.mediaPlayer.start();//調(diào)用這個(gè)變量的start的方法來(lái)實(shí)現(xiàn)音樂(lè)的播放 (上面的只是很簡(jiǎn)單的用法,我們?cè)趯?shí)際開(kāi)發(fā)的時(shí)候要學(xué)會(huì)活學(xué)活用)查看全部
舉報(bào)
0/150
提交
取消