問題描述
我最近更新了eclipse,SDK和我的問題是
I recently updated eclipse, SDK and my problems are
- 默認采用
fragment_main.xml
- 將默認活動擴展到
ActionBarActivity
- 默認添加庫
appcompat 7
我在添加庫時沒有任何問題,但是當我嘗試運行時,它并沒有在設備中執行(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.
如果我將它擴展到 Activity 并再次運行它,下次在創建新的 Activity 時會出現同樣的問題......
If i extends it to Activity and run it and again for the next time the same problem arises while creating new Activity like...
創建 2 個擴展 ActionBarActiity 的 xml 文件.
Creating 2 xml files with extending ActionBarActiity.
我只希望新類擴展 Activity
而不是 ActionBarActivity
我的目標設備是 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 自帶.這對開發人員來說是一個加分項,因為開發人員不需要手動將 ActionBarActivity 添加到他們的項目中.您的問題有兩種解決方案.
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 文件中擴展 Activity.
兩者都適合你.
這篇關于默認情況下,android 創建新項目為 ActionBarActivity的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!