This problem is faced when I am copying another copy of a project that is similar by name and on the same disk but after a few seconds I noticed this and cancel the operation of copying the other project, unfortunately, it seems to override some of the files in the first project
Error message when Running the first project :
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
List of apks:
[0] 'C:\Users\hp\Desktop\TrafficAccident\app\build\outputs\apk\debug\app-debug.apk'
Installation failed due to: 'null'
How to fix it?
In manifest file add android:exported="true" in the launcher activity tag
<activity
android:name=".MainActivity"
android:alwaysRetainTaskState="true"
android:configChanges="orientation|screenSize"
android:exported="true"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Related
I have created the meat and guts of my application but I want to add a different activity that will be the starting point (sort of a log-in screen).
Couple questions:
1 I have a fairly decent handle on how to switch between activities (based on this article: http://www.linux-mag.com/id/7498) but I'm not sure how to go about creating a new one (with eclipse).
2 Once I have a new activity created, how can I set it as the default activity of my application? I presume I could just change the name of the classes...but is there a more elegant way to handle that (maybe within the AndroidManifest.xml)?
Yes, you use the AndroidManifest.xml file. You can actually even have more than one launcher activity specified in your application manifest. To make an activity seen on the launcher you add these attributes to your activity in the manifest:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Go to AndroidManifest.xml in the root folder of your project and change the Activity name which you want to execute first.
Example:
<activity android:name=".put your started activity name here"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
If you are using Android Studio and you might have previously selected another Activity to launch.
Click on Run > Edit configuration and then make sure that Launch default Activity is selected.
<application
android:icon="#drawable/YOUR_ICON" <!-- THIS ICON(IMAGE) WILL BE SHOWN IN YOUR APPS -->
android:label="MY APP NAME " > <!-- HERE LABEL(APP NAME) -->
<activity
android:name=".application's starting activity" <!-- (.)dot means current dir, if your activity is in another package then give full package name ex: com.xxx.Activity -->
android:label="LABEL FOR ACTIVITY "
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Follow to below instructions:
1:) Open your AndroidManifest.xml file.
2:) Go to the activity code which you want to make your main activity like below.
such as i want to make SplashScreen as main activity
<activity
android:name=".SplashScreen"
android:screenOrientation="sensorPortrait"
android:label="City Retails">
</activity>
3:) Now copy the below code in between activity tags same as:
<activity
android:name=".SplashScreen"
android:screenOrientation="sensorPortrait"
android:label="City Retails">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and also check that newly added lines are not attached with other activity tags.
This is easy to fix.
Changes to the Launcher activity are also stored in the Debug configuration.
Go to Run > Debug Configurations and edit the setting.
There is also a similar setting in Intellij under Run > Edit Configurations select Run default Activity and it will no longer save the setting in this fashion.
It's simple. Do this, in your Manifest file.
<activity
android:name="Your app name"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Just go to your AndroidManifest.xml file and add like below
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
then save and run your android project.
You add this you want to launch activity
android:exported="true" in manifest file like
<activity
android:name=".activities.activity.MainActivity"
android:windowSoftInputMode="adjustPan"
android:exported="true"/>
<activity
Open java file of this activity and right click then click on Run 'main Activity'
OR
Open java file of this activity and press Ctrl+Shift+F10.
In a recent project I changed the default activity in AndroidManifest.xml with:
<activity android:name=".MyAppRuntimePermissions">
</activity>
<activity android:name=".MyAppDisplay">
<intent-filter>
<action android:name="android.intent.activity.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
In Android Studio 3.6; this seems to broken. I've used this technique in example applications, but when I use it in this real-world application it falls flat. The IDE once again reports:
Error running app: Default activity not found.
The IDE still showed a configuration error in the "run app" space in the toolbar (yellow arrow in this screenshot)
To correct this error I've tried several rebuilds of the project, and finally File >> "Invalidate Cache/Restart". This did not help. To run the application I had to "Edit Configurations" and point at the specific activity instead of the default activity:
In AndroidManifest.xml
I changed here the first activity to be MainActivity4 instead of MainActivity:
Before:
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity2" />
<activity android:name=".MainActivity3" />
<activity android:name=".MainActivity4" />
<activity android:name=".MainActivity5" />
<activity android:name=".MainActivity6"/>
After:
<activity android:name=".MainActivity" />
<activity android:name=".MainActivity2" />
<activity android:name=".MainActivity3" />
<activity android:name=".MainActivity4" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity5" />
<activity android:name=".MainActivity6"/>
For anyone getting errors in their debug\AndroidManifest.xml file make sure that you include the tag!
"<activity android:name=".MainActivity>"
For example:
<activity android:name=".MainActivity"><intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter></activity>
This question already has answers here:
android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify
(35 answers)
Closed 4 months ago.
I have updated my emulator version and Android SDK version to Android S (Android 12). After the update, I cannot run the project. I cannot run a Hello, World! project (empty project), but I can build Gradle as well as, but I can not run the project. I always got the error:
Manifest merger failed: Apps targeting Android 12 and higher are
required to specify an explicit value for android: exported when the
corresponding component has an intent filter defined. See
https://developer.android.com/guide/topics/manifest/activity-element#exported
for details.
How can I fix it?
Here is a screenshot:
How can I solve this issue when using Android 12 SDK?
This question is about the issue after applying the solution to this, and is different than this question. Also, this question is older than this.
You need to specify android:exported="false" or android:exported="true"
Manifest:
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="#style/Theme.MyApplication.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
as mentioned in the document:
If your app targets Android 12 and contains activities, services, or
broadcast receivers that use intent filters, you must explicitly
declare the android: exported attribute for these app components.
Warning: If an activity, service, or broadcast receiver uses intent
filters and doesn't have an explicitly-declared value for
android:exported, your app can't be installed on a device that runs
Android 12.
Also check when to use true/false for the 'android:exported' value.
In your manifest, add android:exported="true" or android:exported="false " in your default launching activity attribute.
Done! You are all right to run your apps on Android 12.
<manifest ... >
<activity
android:name=".ui.dashboard.DashboardActivity"
android:screenOrientation="portrait"
android:exported="true"
android:theme="#style/AppTheme.Launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</manifest>
Set the android:exported value according to your requirement.
Whether the broadcast receiver can receive messages from non-system sources outside its application — "true" if it can, and "false" if not. If "false", the only messages the broadcast receiver can receive are those sent by the system, components of the same application, or applications with the same user ID.
If unspecified, the default value depends on whether the broadcast receiver contains intent filters. If the receiver contains at least one intent filter, then the default value is "true". Otherwise, the default value is "false".
This attribute is not the only way to limit a broadcast receiver's external exposure. You can also use permission to limit the external entities that can send messages (see the permission attribute).
From Android Documentation
If you didn't find in your manifest the place where there is an activity without the tag "android: exported = false" then it's likely that it is in your dependencies... in order to pinpoint where exactly, first downgrade "compileSdkVersion" to 30 and "targetSdkVersion" to 30 so it builds.
android {
compileSdkVersion("android-S")
buildToolsVersion "30.0.3"
defaultConfig {
...
minSdkVersion 23
targetSdkVersion("S")
...
}
After that, in the main manifest.xml window there is a tab with "merged manifest". There you can inspect what activity exactly didn't have the "android: exported = false" attribute.
In my case it was because of third-party tools:
File build.gradle (: app):
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
//and
debugImplementation "com.github.markzhai:blockcanary-android:1.5.0"
releaseImplementation "com.github.markzhai:blockcanary-no-op:1.5.0"
Also, for services I had to add the attribute:
<service
android:name=".autofillservice.MyAutofillService"
android:exported="true"
android:permission="android.permission.BIND_AUTOFILL">
and
<service
android:name="com.demo.myApp.my_access.MyAccessService"
android:enabled="true"
android:exported="true"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
As my problem was in a third-party dependency and it's not going to be updated soon, I just added a <activity> declaration with the flag android:exported="true" and exported="false" where needed to override the initial declaration, also as I need this dependency in Debug only I added a new AndroidManifest.xml file in src/debug:
For leak_canary:
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity
android:name="leakcanary.internal.activity.LeakActivity"
android:exported="true"
android:icon="#mipmap/leak_canary_icon"
android:label="#string/leak_canary_display_activity_label"
android:taskAffinity="com.squareup.leakcanary.${applicationId}"
android:theme="#style/leak_canary_LeakCanary.Base">
<intent-filter android:label="#string/leak_canary_import_hprof_file">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:host="*" />
<data android:pathPattern=".*\\.hprof" />
<data android:pathPattern=".*\\..*\\.hprof" />
<data android:pathPattern=".*\\..*\\..*\\.hprof" />
<data android:pathPattern=".*\\..*\\..*\\..*\\.hprof" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.hprof" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.hprof" />
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.hprof" />
</intent-filter>
</activity>
<activity
android:name="leakcanary.internal.RequestStoragePermissionActivity"
android:excludeFromRecents="true"
android:exported="false"
android:icon="#mipmap/leak_canary_icon"
android:label="#string/leak_canary_storage_permission_activity_label"
android:taskAffinity="com.squareup.leakcanary.${applicationId}"
android:theme="#style/leak_canary_Theme.Transparent" />
<receiver
android:name="leakcanary.internal.NotificationReceiver"
android:exported="false" />
</application>
</manifest>
You might as well just use the tools:node="merge" attribute and declare the android:exported=true|false as LeoFarage kindly suggested.
I ran into the same issue after targeting Android 12 in my project.
The problem was the project was quite big, with multiple AndroidManifest.xml files, and android:exported missing in many places.
I ended up creating a Gradle task to fill the missing android:exported attributes automatically for me.
Here is the link.
I had to also add android:exported="true" to all my receivers declared in the manifest. So I had something like this:
<receiver android:name=".alarms.AlarmReScheduler"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<!-- For HTC devices -->
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
I don't think you should add android:exported="true" to just everything. You should only add that when those Broadcast receivers need to be visible to Android OS. The Intent filters in that code mean that I wanted Android OS to wake up my Android app and perform an operation.
android.intent.action.BOOT_COMPLETED is a very good example because Android OS sends broadcasts to every application installed in the device. So technically, it would mean that any Broadcast receiver that has an intent filter with actions should always declare android:exported="true".
For apps targeting Android 12
Change your app's targetSdkVersion to S (32 or 31) to enable the new behavior.
Then specify the android:exported="" attribute in Manifest to either true or false depending on Activity.
For a launcher activity such as splash or MainActivity, use android:exported="true" and for the rest of the Activities, use android:exported="false"
For example:
<!-- It's **true** for the launcher Activity -->
<activity android:name=".SplashActivity"
android:exported="true" />
<!-- It's **false** for the rest of the Activities -->
<activity android:name=".MainActivity"
android:exported="false" />
Your question may have flagged for duplication because of this post: Manifest merger failed targeting Android 12, although yours was posted a week earlier. I don't see the flag now.
To clarify another answer, note that android:exported should be set true for your main activity, or it won't launch despite an encouraging 'Launch succeeded' message from Android Studio as no other app, or even the Android system itself, can launch it.
<activity
android:name=".MainActivity"
android:exported="true"
For other activities with intents buried in your merged manifests, this would normally be set to false.
In your manifest, add android:exported="true" or android:exported="false " in your default launching activity attribute.
Done! You are all right to run your apps on Android 12.
Required by launcher activity
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="#style/Theme.MyApplication.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Required by receiver
<receiver android:name=".Musicreceiver"
android:exported="true">
</receiver>
Required by services
<service
android:name=".service.LoggerService"
android:exported="true"
android:enabled="true" />
In your launcher activity, declare "android: exported":
<activity android:name=".MainActivity"
android:exported = "false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
If true “android: exported= true” it means the activity is accessible to any app and can be launched by its exact class name.
If false “android: exported = false” it means the activity can be launched only by the components of the same application with the same user ID, or privileged system components.
For more details check here.
Add android:exported="true":
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions"/>
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher"/>
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
Update the version of androidTestImplementation 'androidx.test.ext:junit:1.1.1' to the latest version, like:
androidTestImplementation 'androidx.test.ext:junit:1.1.3' from the build.gradle app level.
For me neither of the solutions worked, even if I double/triple checked the "merged manifest" in Android Studio. After compiling the project, the error just appeared and I couldn’t identify the line where the issue was generated.
Solution: make sure you're targeting the latest libraries in your project. I was using Unity, StartApp and Flurry Analytics. I forgot to update these libraries, and after upgrading them, the error disappeared. It looks like these libraries used features from
before SDK 31.
If you're using abandoned libraries, then you should consider replacing them.
I was getting this error even when I added android:exported="true" in all activities, receivers etc. The thing that worked for me was to change compileSdkVersion and targetSdkVersion to 30.
This will help for 2021 users.
In one of your two build.gradle files you should be able to find the line targetSDK 31. Change that to 30 and then do a gradle sync (a small bar will appear above the main code window where you can click "Sync now") and you should be good to go.
I am trying to add the latest FirebaseUI dependency to my Android project. I have Facebook login enabled in my project, and when I set up the Facebook login I was required to add my Facebook App ID in the Android manifest. Here is the dependency I added to my android project:
"com.firebaseui:firebase-ui:3.0.0"
After compiling, I received the following error:
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#com.facebook.sdk.ApplicationId#value value=() from AndroidManifest.xml:29:13-52
is also present at [com.firebaseui:firebase-ui-auth:3.0.0] AndroidManifest.xml:21:13-60 value=().
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:27:9-29:55 to override.
I am not sure why I am being prompted to change my Facebook App ID in order to use the latest library. I am updating so that I can take advantage of the new FirebaseUI features and Firebase Cloud Firestore as well.
Manifest
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="#drawable/xxxxxxx"
android:label="#string/xxxxxxx"
android:theme="#style/AppTheme.NoActionBar"> <!-- ADD THIS LINE -->
<activity
android:name=".SignupActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
tools:replace="android:theme" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<meta-data
android:name="com.firebase.ui.GoogleClientId"
android:value="#string/google_client_id" />
<meta-data
android:name="com.firebase.ui.TwitterKey"
android:value="#string/twitter_app_key" />
<meta-data
android:name="com.firebase.ui.TwitterSecret"
android:value="#string/twitter_app_secret" />
<activity
android:name=".PollHostActivity"
android:label="#string/title_activity_poll"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".LoadingActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".HomeActivity"
android:screenOrientation="portrait" />
<activity
android:name=".CreateActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name=".NewImageActivity"
android:theme="#style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
<activity
android:name=".ProfileActivity"
android:label="#string/title_activity_profile"
android:theme="#style/AppTheme.NoActionBar"></activity>
</application>
Your post says: when I set up the Facebook login I was required to add my Facebook App ID in the Android manifest. That is not the case for firebase-ui-auth:3.1.0 and may not be for 3.0.0 either. With 3.1.0, you define the IDs as string resources, as described here, and FirebaseUI generates the needed manifest entries, which get merged into the main manifest at build time. If you are defining the constants in your manifest manually, that is likely the cause of the merge conflict.
To see the contributors to the merged manifest, open your AndroidManifest.xml file in Android Studio. Click the Merged Manifest tab at the bottom of the window. In the right pane, find and click on firebase-ui-auth:3.0.0 to see the manifest entries that are generated by FirebaseUI for merging into the composite manifest. If you see meta-data entries there that you have manually entered into your manifest, delete your entries to eliminate the merge conflict.
Try following their GitHub readme, located here. I was having the same problem as well and my question got a lot of attention but unluckily none could pin point the problem. The problem lies somewhere in the gradle file where you are writing this "com.firebaseui:firebase-ui:3.0.0".
So my original problem was that in my manifest my menu wasent loading ie
<activity
android:name=".MainMenu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.th3ramr0d.learnar670_1.MAINMENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
This was fixed by loading it at startup ie
<activity
android:name=".MainMenu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
So now my main menu works. However, the buttons inside MainMenu.xml will take you to another .xml file with more buttons. So now I have the same problem. I created another class called SubMenuChapter3 and put it in the manifest as such.
<activity
android:name=".SubMenuChapter3"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.th3ramr0d.learnar670_1.SUBMENUCHAPTER3" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Now this doesnt work I am assuming for the same reason as before with mainmenu. Doesnt crash or give me errors. It just wont open the submenuchapter3 class. I forced the submenuchapter3 class to open by putting
startActivity(new Intent("com.th3ramr0d.learnar670_1.SUBMENUCHAPTER3"));
directly into the MainMenu class outside of an onclick just to see if it was working. When I do that it opens the chapter_3.xml like it is supposed to and the button works. Thanks for the help.
You misunderstood <intent-filter> tag and the way you start activities.
Also maintain proper terminology - Menu and Activity are completely different things.
Everything you need to know about Activities can be found here: Activities | Android Developers
Example:
This entry in AndroidManifest.xml says "show the MainMenu Activity as icon in the launcher":
<activity
android:name=".MainMenu"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
EDIT: This allows Android to start MainActivity. It will also show in the installed app list.
The following Activity will not be displayed in launcher but can be opened from the app:
<activity android:name=".SubMenuChapter3"/>
EDIT: This allows Android to start SubMenuChapter3. It won't show in the installed app list.
These lines say "open the SubMenuChapter3 Activity":
Intent i = new Intent(this, SubMenuChapter3.class);
startActivity(i);
EDIT: You call this code from inside the onClick method inside MainMenu. It will launch SubMenuChapter3.
I'm a newbie programming for android, I made a simple game some days ago and I tried to install it in a tablet(Android 4.0).
The program works ok, but I got four(4) icons of my app after installation and only one of them is correct(third).
I just want to know how I can to solve this bug so that when I install it in another device it runs ok and get only one icon.
Thanks in advance.
It's because in your manifest you need to change all of your activities EXCEPT your first activity (usually your mainActivity) from:
<activity
android:name=".SecondActivity"
android:label="activity name" >
<intent-filter
android:label="Your App Name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
to:
<activity
android:name=".SecondActivity"
android:label="activity name" >
</activity>
Basically just take the intent-filter out of all your activities that are NOT your main activity. Your main activity needs it so that there is a launcher icon. Hope that helps.
I got four(4) icons of my app after installation
means you have declared more then one Activity in AndroidManifest.xml as launch Activity. to show only one Activity as launcher you will need to declare only one Activity with android.intent.action.MAIN and android.intent.category.LAUNCHER intent-filter.
Declare Main Activity which u want to show in Launcher as:
<activity android:name="MainActvity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and other 3 Activity declare as in AndroidManifest.xml as :
<activity android:name="Actvity_Two"
android:label="#string/app_name" />
<activity android:name="Actvity_Three"
android:label="#string/app_name" />
//declare other in same way ..