I'm working on an Android app using Eclipse and just started noticing a weird glitch.
When I deploy the app to my phone for some reason multiple app icons appear in my "Apps" folder area. Each icon brings me to a different class page within my app when tapped. Has anyone else experienced this as well?
Here's a screenshot of the issue when running the app from the emulator on my laptop.
Since the issue is appearing in the emulator I know that it isn't my phone that's causing the error.
Each of the icons you see in that screenshot represents a different activity in my manifest file.
Here's how the activity is set up in my manifest.
<activity android:name=".MainJava">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".AppClass">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Would you say that this error being caused because of the way that I am setting up the activities? If so, how would you suggest that I edit the activities to fix this problem?
I've never seen this in any of the apps I've built before this one.
Only MainActivity(Launcher Activity) have intent filter with action as Main and category as Launcher,
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
And Remove this Two line For other Activity.
Change from:
<activity android:name=".MainJava">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".AppClass">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
To:
<activity android:name=".MainJava">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".AppClass">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
There should be only one MAIN and one LAUNCHER
Related
I am trying to recognize the following as a deep link in android
wc:1a15e8b5-8470-47fa-985f-cf11b4c89067#1?bridge=https%3A%2F%2Fbridge.walletconnect.org&key=f92fb2ed74d628a6a286e416e4df2fbfa88d58e6826007c021b9f5920567cdd5
I have set up my AndroidManifest to be as follows:
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|screenLayout|layoutDirection|keyboard|keyboardHidden"
android:launchMode="singleTask"
android:theme="#style/AppTheme.Launcher"
android:windowSoftInputMode="stateHidden|adjustPan|adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wc" />
</intent-filter>
</activity>
However when I try to scan the relevant qr with the camera app, nothing happens.
What am I missing?
After installing an app via the run command on Android Studio, the app launches correctly, I can see it in the applications list and account manager.
The problem is that it doesn't show up at all in the app launcher. (I have Google Launcher installed on the Nexus 5 device which I am testing on and everything was working fine before 6.0.1).
App name is "Pumpkin".
Here is the manifest
And here's the screenshot where Pumpkin's supposed to fit.
Your Intent-Filter seems to be wrong. Change to:
<activity
android:name="com.pumpkin.activities.SplashScreenActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="pumpkin.com" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Add this intent filter to your splash screen activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
your deep link
https://sureassure.com
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Main2Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="sureassure.com" // website name
/>
</intent-filter>
</activity>
</application>
I have created a custom launcher and its perfectly working fine.Now i want to add an activity to it which shall be launched like any other app from launcher.
Here is my Manifest file.
<activity
android:name="com.sample.launcher2.Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:resumeWhilePausing="true"
android:theme="#style/Theme"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="nosensor">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</activity>
<activity
android:name="com.sample.launcher2.MainActivity"
android:label="#string/application_name"
android:icon="#mipmap/ic_launcher_home">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I am not able to launch activity from launcher.How can i achieve it ?
Make following changes hope it will work
<activity
android:name="com.sample.launcher2.Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:resumeWhilePausing="true"
android:theme="#style/Theme"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="nosensor">
<intent-filter>
<action android:name="com.sample.launcher2.Launcher" />//Here the change
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</activity>
<activity
android:name="com.sample.launcher2.MainActivity"
android:label="#string/application_name"
android:icon="#mipmap/ic_launcher_home">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME"/>
</intent-filter>
</activity>
Changing that activity's launch mode to singleTask may help!
Currently my ActivityMain.java is main in my app android. How can I change the activity that started with my android app ?
Thank you so much.
In you manifest, put
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
between Activity tag
<activity
android:name="com.some.activity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I have an Activity that is both the MainActivity and the activity that should be started when the 'Share'-Button within the Gallery is clicked.
So my Manifest looks like this:
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEND" />
</intent-filter>
</activity>
With the above manifest, by app appears within the share menu but not in the app drawer. If I remove the line that sets the mimeType the app appears in the app drawer but not within the share menu in the gallery.
Any suggestions how to achieve both?
Thanks in advance.
Use two separate <intent-filter> elements in the <activity>: one for MAIN/LAUNCHER, the other for SEND/DEFAULT/MIME type.
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<action android:name="android.intent.action.SEND" />
</intent-filter>
</activity>