user3220442
user3220442

Reputation: 1

Application icon not appearing on the screen after compilation

Hi I am not able to find my application icon on the screen after installation of the app in the phone or in the virtual device .

The following are the changes done in AndroidManifest.xml I have added the icon

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myfirstandroidapllication"
    android:versionCode="1"
    android:versionName="1.0" >

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
        android:name="hello.world.MyHelloWorld"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    </application>
</manifest>

and I have checked all the res folders for icons default icons are present. application is running succesfully when started from eclipse in emulator after adding action in manifest file . but no icon in the emulator also

The following are the changes in R.java

public static final class drawable {
        public static final int icon=0x7f020000;
}

but also I am not able to view the icon after installation even in the mobile ie installation is success but icon is not visible on the screen

Upvotes: 0

Views: 343

Answers (3)

Dimmerg
Dimmerg

Reputation: 2138

You are not declared your start activity into the manifest:

    <activity android:name=".YourStartActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

After adding this into application tag, you will see app icon on launcher and tap on it will start YourStartActivity

Upvotes: 1

Rahul Gupta
Rahul Gupta

Reputation: 5295

you have not defined an activity in your manifest as launcher :-

<?xml version="1.0" encoding="utf-8"?>

<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.globaldialog.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
 </application>

Upvotes: 2

Nathua
Nathua

Reputation: 8826

<intent-filter>
  //
  <category android:name="android.intent.category.LAUNCHER" />
  //
</intent-filter>

your launcher activity could be missing this intent filter, If yes, you need to add it.

Upvotes: 0

Related Questions