本文為大家總結了Andriod開發(fā)中常遇到的問題,供大家學習,具體內容如下
1.Andriod中布局中引用布局的問題 (使用如下方法即可,布局中引用布局可以起到節(jié)省資源的問題)
<LinearLayout><include layout="@layout/buttom"></LinearLayout>
2.如何判斷你的手機版本是不是4.0以上
if(Android.os.Build.VERSION.SDK_INT>10)
3.屏幕切換問題和Activity重啟的問題
在需要的Activity中添加
android:screenOrientation="portrait" //屏幕只能豎屏顯示 android:configChanges="keyboardHidden|orientation"http://屏幕切換時保證Activity不會重啟
4.去掉apk頭部的辦法
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
直接加在super.onCreate(savedInstanceState);上面即可
5.Andriod中怎么調用手機系統(tǒng)的設置界面
Intent mIntent = new Intent();ComponentName comp = new ComponentName("com.android.settings", "com.android.settings.WirelessSettings");mIntent.setComponent(comp);mIntent.setAction("android.intent.action.VIEW");startActivity(mIntent);6.Eclispe引入第三方架包的方法
只與當前項目關聯(lián): 在當前項目上右鍵->Properties->Andriod,點擊Add按鈕,將A工程加入,然后Apply
7.
將int型轉成String型
String.valueOf(int)
將String型轉成int型
Iterger.parseInt(str)
以上就是Andriod開發(fā)中常見的問題,希望對大家學習Android軟件編程有所幫助。
新聞熱點
疑難解答
圖片精選