我使用Intellij Idea Community Edition v13 我不能使用 因为;我显示错误:@ style / Theme.AppCompat.Light 无法解析
我添加支持v7库;的文件>项目结构>库; 有2个库 [android-support-v4和android-support-v7-appcompat ]
的AndroidManifest.xml;
<uses-sdk android:minSdkVersion ="7"/>
<uses-sdk android:targetSdkVersion ="17"/>
...
..
<activity
android:name =".MyApp"
android:label ="@string/AppName">
<intent-filter>
<action android:name ="android.intent.action.MAIN"/>
<category android:name ="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
-
MyApp.class的;
...
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
...
public class Sozler extends ActionBarActivity{
...
-
在我的&gt; MyApp类;
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
成功运行Android 3.0+设备 ,但当我使用Android 2.3设备时;
&GT;我看到异常;
java.lang.ExceptionInInitializerError
at android.support.v7.app.ActionBarActivityDelegate.createDelegate(ActionBarActivityDelegate.java:54)
at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:96)
at com.kibar.App.MyApp.onCreate(MyApp.java:16)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)