确定你源文件中的activity的类名和xml中的是否一致。

解决方案 »

  1.   


    你好,我查看了一下,你所讲的xml应该是Manifest.xml中的android:name吧,是跟activity类名一样的,都是android:name=".MainActivity"
      

  2.   

    at com.example.helloandroid.MainActivity.onCreate(MainActivity.java:14)看看MainActivity类的第14行代码,有没有问题...
      

  3.   

    log里告诉你原因了
    Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
    具体在下面:
    at com.example.helloandroid.MainActivity.onCreate(MainActivity.java:14)
      

  4.   

    很明显是在Activity创建时出错了,请检查oncreate()方法中是否有错,如果无法定位,请将代码粘贴出来供大家为你提供进一步帮助。
      

  5.   

    Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
      

  6.   

    感谢大家~下面是代码
    12 protected void onCreate(Bundle savedInstanceState) {
    13 super.onCreate(savedInstanceState);
    14 setContentView(R.layout.activity_main);
    15 TextView tv=new TextView(this);
    16 tv.setText("Hello World");
    17 setContentView(tv);
    18 }
      

  7.   

    http://blog.csdn.net/jansin_love/article/details/8845419或者你把application的style属性修改下
      

  8.   

    07-23 09:30:51.306: E/AndroidRuntime(1752): FATAL EXCEPTION: main
    07-23 09:30:51.306: E/AndroidRuntime(1752): Process: com.android.criminallnetent, PID: 1752
    07-23 09:30:51.306: E/AndroidRuntime(1752): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.criminallnetent/com.android.criminallnetent.CrimeListActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
    -----------------------------------------------------------------------------------------------
    try changing target sdk version to 19
    check here targetSdkVersion setting
    Do not use API Level of 20 and Platform 4.4W, as Android Virtual Device. With Level 19 and Platform 4.2.2 set on AVD everything runs as it should. <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="17" />
      

  9.   

    创建虚拟机的时候不要用android4.4 ,还有把xml文件中 目标sdk换成小于20的
      

  10.   


    恩,今天我google了一下, 发现也有人有类似的问题,卸载api 20更换成19的就没有问题了,多谢大家。
      

  11.   

    网上有更好的解决方法,大家应该努力搜嘛,就不用这么折腾了
    更改 styles.xml 文件:
    <style name="AppTheme" parent="android:Theme.DeviceDefault">  
      

  12.   

    不好意思,api20是用于可穿戴设备开发的,还是得转到api19下面去或更高版本