简体   繁体   中英

My app won't show up on android emulator and android device

I am a beginner in app development. At first, everything went great, the app showed up both on the emulator and the phone without crashing. After a while, the icon of the app won't show up in the app drawer, and there is no any other way that I could access the app anymore. I recheck everything, there isn't any apparent error in my code, when i ran the program in the emulator and the phone, eclipse showed that the app was installed successfully, but the app won't turn on automatically like it used to, and there is no app icon for me to open the app. Please help!

Attached is my code from the Androidmanifest.xml

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

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.trial1.Splash"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.SPLASH" /> 
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.example.trial1.Mainscreen"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.example.trial1.MAINSCREEN" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.example.trial1.startingPoint"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.example.trial1.STARTINGPOINT" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.example.trial1.Menu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.example.trial1.MENU" /> 
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.example.trial1.TextPlay"
        android:label="@string/app_name" >

    </activity>
    </application>

</manifest>

You have missed to put the action in your launcher activity

<action android:name="android.intent.action.MAIN" />

your correct code look like

 <activity
        android:name="com.example.trial1.Splash"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.intent.action.SPLASH" /> 
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

I had the same problem. This worked for me:

  1. Create a virtual device with AVD manager, be sure to click "Use Host GPU" on Virtual Device Screen.
  2. Start the device. After Android loading screen you will see UI of a mobile device. Wait until seeing UI.
  3. Then you can run your program choosing target as your virtual device that is just loaded and started.
  4. You will see your home page (like Hello world !) on the screen of your device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM