所报异常如图所示:

在虚拟机上并没有程序异常关闭的情况,而是什么反应都没有!!!

解决方法:

注意AndroidManifest.xml文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="our.piano"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".WelActivity"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.NoTitleBar" >

      </activity>
       <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
                 <activity
            android:label="@string/app_name"
            android:name=".OurPianoActivity"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
    </application>

</manifest>

 

改为:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="our.piano"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".WelActivity"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.NoTitleBar" >
      
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
             </activity>
            <activity
            android:label="@string/app_name"
            android:name=".OurPianoActivity"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
    </application>

</manifest>

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐