問題描述
我最近更新了eclipse,SDK和我的問題是
I recently updated eclipse, SDK and my problems are
- 默認(rèn)采用
fragment_main.xml
- 將默認(rèn)活動(dòng)擴(kuò)展到
ActionBarActivity
- 默認(rèn)添加庫
appcompat 7
我在添加庫時(shí)沒有任何問題,但是當(dāng)我嘗試運(yùn)行時(shí),它并沒有在設(shè)備中執(zhí)行(2.3 android).我注意到它并更改為 Activity.
I dont have any issues with adding the library, but when i am trying to run then it is not executing in the device(2.3 android). I noticed it and changed to Activity.
如果我將它擴(kuò)展到 Activity 并再次運(yùn)行它,下次在創(chuàng)建新的 Activity 時(shí)會出現(xiàn)同樣的問題......
If i extends it to Activity and run it and again for the next time the same problem arises while creating new Activity like...
創(chuàng)建 2 個(gè)擴(kuò)展 ActionBarActiity 的 xml 文件.
Creating 2 xml files with extending ActionBarActiity.
我只希望新類擴(kuò)展 Activity
而不是 ActionBarActivity
我的目標(biāo)設(shè)備是 2.3 及以上而不降級它
I just want the new class to extend Activity
but not ActionBarActivity
where my target device is 2.3 and above without downgrading it
推薦答案
SDK v4.4 自帶.這對開發(fā)人員來說是一個(gè)加分項(xiàng),因?yàn)殚_發(fā)人員不需要手動(dòng)將 ActionBarActivity 添加到他們的項(xiàng)目中.您的問題有兩種解決方案.
It comes in SDK v4.4 . It is a plus point for developers because developers don't need to manually add the ActionBarActivity into their project. There are two solutions for your problem.
- 將您的 SDK 降級到 4.3 或更低版本.或
- 刪除 ActionBarActivity 并在您的 java 文件中擴(kuò)展 Activity.
兩者都適合你.
這篇關(guān)于默認(rèn)情況下,android 創(chuàng)建新項(xiàng)目為 ActionBarActivity的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!