我的logcat错误和代码如下:
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
logcat的:
08-15 11:42:43.735: D/AndroidRuntime(1864): Shutting down VM
08-15 11:42:43.735: W/dalvikvm(1864): threadid=1: thread exiting with uncaught exception (group=0xb1d54ce8)
08-15 11:42:43.755: E/AndroidRuntime(1864): FATAL EXCEPTION: main
08-15 11:42:43.755: E/AndroidRuntime(1864): Process: com.example.helloworld, PID: 1864
08-15 11:42:43.755: E/AndroidRuntime(1864): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.helloworld/com.example.helloworld.MainActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.ActivityThread.access$800(ActivityThread.java:138)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.os.Handler.dispatchMessage(Handler.java:102)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.os.Looper.loop(Looper.java:136)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.ActivityThread.main(ActivityThread.java:5026)
08-15 11:42:43.755: E/AndroidRuntime(1864): at java.lang.reflect.Method.invokeNative(Native Method)
08-15 11:42:43.755: E/AndroidRuntime(1864): at java.lang.reflect.Method.invoke(Method.java:515)
08-15 11:42:43.755: E/AndroidRuntime(1864): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
08-15 11:42:43.755: E/AndroidRuntime(1864): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
08-15 11:42:43.755: E/AndroidRuntime(1864): at dalvik.system.NativeStart.main(Native Method)
08-15 11:42:43.755: E/AndroidRuntime(1864): Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
08-15 11:42:43.755: E/AndroidRuntime(1864): at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275)
08-15 11:42:43.755: E/AndroidRuntime(1864): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872)
08-15 11:42:43.755: E/AndroidRuntime(1864): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129)
08-15 11:42:43.755: E/AndroidRuntime(1864): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.Activity.setContentView(Activity.java:1930)
08-15 11:42:43.755: E/AndroidRuntime(1864): at com.example.helloworld.MainActivity.onCreate(MainActivity.java:14)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.Activity.performCreate(Activity.java:5242)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
08-15 11:42:43.755: E/AndroidRuntime(1864): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
08-15 11:42:43.755: E/AndroidRuntime(1864): ... 11 more
答案 0 :(得分:0)
我认为你的目标是错误的设备。如果内存对我有用,听起来你可能会以Android Wear为目标。
如果您正在开发移动应用程序,请将目标sdk更改为API 19
答案 1 :(得分:0)
在你的清单.xml中,将target-sdk更改为19。!