android not launching correct activity - android

I'm not really sure what's going on, but for some reason my SplashActivity is not being created on launch, even though I put the MAIN and LAUNCHER intent for it. Here's my manifest:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_main"
android:theme="#style/Theme.Splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="whatever" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
If I remove the second activity, then my SplashActivity is launched. But for some reason when the MainActivity is included, the Splash is ignored. Is it possible that having the activity name be MainActivity overrides whatever you set for your Launcher activity?
Update:
It seems everybody is suggesting something that I had already tried before posting this question so I think it's better I mention it now before more people post the same suggestion :)
Unfortunately removing the intent on the MainActivity results in the following in my Console output:
[2012-10-11 22:58:44 - Test] ------------------------------
[2012-10-11 22:58:44 - Test] Android Launch!
[2012-10-11 22:58:44 - Test] adb is running normally.
[2012-10-11 22:58:44 - Test] Performing com.test.test.MainActivity activity launch
[2012-10-11 22:58:44 - Test] Automatic Target Mode: using device '9a03c386'
[2012-10-11 22:58:45 - Test] Application already deployed. No need to reinstall.
[2012-10-11 22:58:45 - Test] Starting activity com.test.test.MainActivity on device 9a03c386
[2012-10-11 22:58:45 - Test] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.test.test/.MainActivity }
[2012-10-11 22:58:45 - Test] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.test.test/.MainActivity } from null (pid=12510, uid=2000) not exported from uid 10132
[2012-10-11 22:58:45 - Test] ActivityManager: at android.os.Parcel.readException(Parcel.java:1327)
[2012-10-11 22:58:45 - Test] ActivityManager: at android.os.Parcel.readException(Parcel.java:1281)
[2012-10-11 22:58:45 - Test] ActivityManager: at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1728)
[2012-10-11 22:58:45 - Test] ActivityManager: at com.android.commands.am.Am.runStart(Am.java:433)
[2012-10-11 22:58:45 - Test] ActivityManager: at com.android.commands.am.Am.run(Am.java:107)
[2012-10-11 22:58:45 - Test] ActivityManager: at com.android.commands.am.Am.main(Am.java:80)
[2012-10-11 22:58:45 - Test] ActivityManager: at com.android.internal.os.RuntimeInit.finishInit(Native Method)
[2012-10-11 22:58:45 - Test] ActivityManager: at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:263)
[2012-10-11 22:58:45 - Test] ActivityManager: at dalvik.system.NativeStart.main(Native Method)
Don't know what it means, but I have to assume it's some kind of error.

The section
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
is used to let android know which activity to start when application starts.. Since you wrote it inside both of your activity, android takes second one as the starting activity..
So remove that line from .MainActivity block..
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_main"
android:theme="#style/Theme.Splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="whatever" >
</activity>
After Seeing OP's edit
Have you seen this? Also after changing AndroidManifest.xml file, delete and reinstall the app once..

try this
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_main"
android:theme="#style/Theme.Splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="whatever" >
</activity>

try this :
<activity
android:name="SplashScreen"
android:theme="#style/Theme.Transparent"
android:screenOrientation="landscape"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
and give me review...................

Related

Android Application open from browser No Launcher activity found

Trying to run my application from browser with scheme but getting below logs if i add scheme it show below log and unable to launch app.
[2015-11-18 04:49:50 - app] ------------------------------
[2015-11-18 04:49:50 - app] Android Launch!
[2015-11-18 04:49:50 - app] adb is running normally.
[2015-11-18 04:49:50 - app] No Launcher activity found!
[2015-11-18 04:49:50 - app] The launch will only sync the application package on the device!
[2015-11-18 04:49:50 - app] Performing sync
[2015-11-18 04:49:50 - app] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Nexus_S_API_17'
[2015-11-18 04:49:52 - app] Application already deployed. No need to reinstall.
[2015-11-18 04:49:52 - app] \app\bin\app.apk installed on device
[2015-11-18 04:49:52 - app] Done!
My AndroidManifest.xml as below
<activity
android:name="com.holidaynumbers.MainActivity"
android:label="#string/app_name"
android:configChanges="orientation|screenSize|keyboardHidden"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="allplayer" />
</intent-filter>
</activity>
Tried many different ways to run application with launcher but not able to run it and can't see app icon in apps
try to separate intent filter:
<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="allplayer" />
</intent-filter>

Changing default activity in android

hello I want to change default activity. But when I do that the app doesn't launch at all without any errors
<activity
android:name="com.example.dimmer.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>
<activity
android:name="com.example.dimmer.DevicesActivity" >
</activity>
This way MainActivty launches with no proble. It also goes to Device activity when I press the button. So everything works fine.
Now I need DevcieACtivty to be default one.
I change Manifest like that
<activity
android:name="com.example.dimmer.DevicesActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.dimmer.MainActivity" >
</activity>
but now app doesn't launch. no errors. nothing is written in console.
it's just doesn't do anything,
what might be a problem?
It starts to write the following error
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.dimmer/.MainActivity }
[2014-05-16 21:17:10 - Dimmer] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.dimmer/.MainActivity } from null (pid=13093, uid=2000) requires null
full Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dimmer"
android:versionCode="1"
android:versionName="1.0"
android:hardwareAccelerated="false">
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.dimmer.DevicesActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.dimmer.MainActivity" >
</activity>
</application>
</manifest>
[2014-05-16 22:13:25 - Dimmer] Android Launch!
[2014-05-16 22:13:25 - Dimmer] adb is running normally.
[2014-05-16 22:13:25 - Dimmer] Performing com.example.dimmer.MainActivity activity launch
[2014-05-16 22:13:26 - Dimmer] Uploading Dimmer.apk onto device 'SH17VT514235'
[2014-05-16 22:13:26 - Dimmer] Installing Dimmer.apk...
[2014-05-16 22:13:29 - Dimmer] Success!
[2014-05-16 22:13:29 - Dimmer] Starting activity com.example.dimmer.MainActivity on device SH17VT514235
[2014-05-16 22:13:29 - Dimmer] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.dimmer/.MainActivity }
[2014-05-16 22:13:29 - Dimmer] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.dimmer/.MainActivity } from null (pid=15458, uid=2000) requires null
Since you've defined your package as "com.example.dimmer", you can remove package name and use just the name of Activity with dot in front:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".DevicesActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity" >
</activity>
</application>
Moreover, check your Run configuration settings in Eclipse. If your launching activity was set to MainActivity, and in manifest you make DevicesActivity as main, your app might not start when launching via Eclipse. Click arrow for RUN icon and choose "Run Configurations",
Then make sure you choose DevicesActivity as Launch:
Uninstall the app on your phone, and redownload it.
Make sure you implement setContentView in onCreate method.
In other way try clean the project Project > Clean and run it.
I am not sure but Now you can some step a head.
such as
1. delete Android.R (in above in your activity )
2. or replace package.R for example , com.example.name.R
3. check you res folder or sub-folder resources .
such as layout attribute right or not.
4. Delete gen and bin folder.
5. clean your project thus: project=>clean
6. restart your eclipse.
Remember that if your resource not found then show this type error.
Best of luck!
Click arrow for RUN icon and choose "Run Configurations"
Android Application =>select project
open Target tab
select Always prompt to divice
click run and select Divice online

Android emulator not loading an app

Whenever I try to run an app on the Android emulator, from the eclipse in the adt bundle, the emulator loads and the console outputs this:
[2013-06-18 06:34:02 - Counter] No Launcher activity found!
[2013-06-18 06:34:02 - Counter] The launch will only sync the application package on the device!
[2013-06-18 06:34:02 - Counter] Performing sync
[2013-06-18 06:34:02 - Counter] Automatic Target Mode: launching new emulator with compatible AVD 'Anroid_emulator'
[2013-06-18 06:34:02 - Counter] Launching a new emulator with Virtual Device 'Anroid_emulator'
[2013-06-18 06:34:03 - Counter] New emulator found: emulator-5554
[2013-06-18 06:34:03 - Counter] Waiting for HOME ('android.process.acore') to be launched...
[2013-06-18 06:34:37 - Counter] HOME is up on device 'emulator-5554'
[2013-06-18 06:34:37 - Counter] Uploading Counter.apk onto device 'emulator-5554'
[2013-06-18 06:34:37 - Counter] Installing Counter.apk...
[2013-06-18 06:35:12 - Counter] Success!
[2013-06-18 06:35:12 - Counter] \Counter\bin\Counter.apk installed on device
[2013-06-18 06:35:12 - Counter] Done!
Have you checked whether your app has been installed or not by going inside the menu?
Because if you have forgotten to make your activity as the launcher activity, your app will not pop up and you may not notice that your app has already been installed.
You can make that activity as launcher in the manifest by the below given tags:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.LAUNCHER" />
I think you seem to be missing these in your manifest XML for the Activity that is the app's primary:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
For example, if your main activity is called MainActivity, it should look like this:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/FooDzines" >
<activity
android:name="MainActivity"
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.LAUNCHER" />
</intent-filter>
</activity>
....
....
</application>

app is installed but not launching on my emulator

In my emulator app installed successfully but app is not launching ,here i am pasting the console details
here i am adding manifest file as well ,i added intent-filter as well.
i hope this info is enough but stackoverflow needs some more info .
[2012-12-13 20:29:52 - PongUr2] Android Launch!
[2012-12-13 20:29:52 - PongUr2] adb is running normally.
[2012-12-13 20:29:52 - PongUr2] No Launcher activity found!
[2012-12-13 20:29:52 - PongUr2] The launch will only sync the application package on the device!
[2012-12-13 20:29:52 - PongUr2] Performing sync
[2012-12-13 20:29:52 - PongUr2] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'AVD_4.0'
[2012-12-13 20:29:52 - PongUr2] Uploading PongUr2.apk onto device 'emulator-5554'
[2012-12-13 20:29:53 - PongUr2] Installing PongUr2.apk...
[2012-12-13 20:30:00 - PongUr2] Success!
[2012-12-13 20:30:01 - PongUr2] \PongUr2\bin\PongUr2.apk installed on device
[2012-12-13 20:30:01 - PongUr2] Done!
HereÅ› the xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sabrebutt.pongur"
android:versionCode="49"
android:versionName="0.8.8.2" >
<application
android:icon="#drawable/icon"
android:label="#string/app_name" >
<service
android:name="PongUr"
android:enabled="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter android:priority="1" >
<action android:name="android.service.wallpaper.WallpaperService" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/pongur" />
</service>
<activity
android:name="PongUrSettings"
android:exported="true"
android:label="#string/pongur_settings"
android:theme="#android:style/Theme.Black" >
</activity>
</application>
<uses-sdk android:minSdkVersion="7" />
/>
</manifest>
None of your activities have launcher intent filter, Add below lines to the activity you want to launch in your manifest
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Edit:
You cannot have an intentfilter inside an intentFilter and the launcher intent filter will not work on service, only Activities can be launched and can have UI
<activity
android:name="PongUrSettings"
android:exported="true"
android:label="#string/pongur_settings"
android:theme="#android:style/Theme.Black" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Try going Setting -> Application(apps) --> uninstall your app & run again your app . May be it should work.Sometimes previous installation creates this type problem.Otherwise may be problem with your menifest file.
Not specific to this particular error. When app is installed and not launched, you can check the 'Launch options' in 'Run Configuration'. It should be selected as 'Default Activity'.

Android - error while trying to launch: ActivityManager: java.lang.SecurityException: Permission Denial

I'm trying to luanch my application, and this is the log:
[2012-03-07 19:45:12 - hhs] Android Launch!
[2012-03-07 19:45:12 - hhs] adb is running normally.
[2012-03-07 19:45:12 - hhs] Performing hhs.pack.HhsActivity activity launch
[2012-03-07 19:45:15 - hhs] Application already deployed. No need to reinstall.
[2012-03-07 19:45:15 - hhs] Starting activity hhs.pack.HhsActivity on device emulator-5554
[2012-03-07 19:45:16 - hhs] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=hhs.pack/.HhsActivity }
[2012-03-07 19:45:16 - hhs] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=hhs.pack/.HhsActivity } from null (pid=-1, uid=-1) requires null
I've been searching for some answers and understood that the problem is from my manifest file. The problem is that I didn't touch my manifest for a long time (and it works today with the same manifest.
Anyway, as I assume the manifest is important, this is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="hhs.pack"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".HhsActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black" >
</activity>
<activity android:name="SimpleServiceActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".Service.SimpleService"></service>
</application>
</manifest>
The weird thing is:
[2012-03-07 19:45:15 - hhs] Application already deployed. No need to reinstall.
That sound like your app ist deployed. Try to manually deploy it or increase the versionCode.
Try
adb install -r
so he will deploy even if the versionCode is equal or higher to your current versionCode
EDIT
Try to replace this line
<activity android:name="SimpleServiceActivity" android:label="#string/app_name">
with this one:
<activity android:name=".SimpleServiceActivity" android:label="#string/app_name">
Or where ever the package with the activity is located. The important thing here is the [.] before your Activity. Without that it is unknown that your Activity is in the root package.
Make sure you have your app listed in the application nodes. I've had many a times tried to figure out why an app wouldn't run when it was as simple as that.
Also check that you have an intent filter on the activity for android.intent.action.SEARCH
and make sure you have the meta filters:
<meta-data android:resource="#xml/searchable"
android:name="android.app.searchable"></meta-data>
<meta-data android:name="android.app.default_searchable"
android:value=".MyActivity" />

Categories

Resources