I have an android application, I'm trying to put a splash screen in via a tutorial I found and I added an additional activity to the manifest "SplashScreen", however my other activity still loads first. If I take the other one out, the splash screen will load but crashes. How can I get the SplashScreen to load first?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="projectmp.android"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name" android:debuggable="true">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".SplashScreen"
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=".MissionPlanner"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="projectmp.android.MissionPlanner" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Thanks
Whatever you are launching it from still thinks that it is trying to launch MissionPlanner. It may be caching an earlier definition of your application. The default home screen launcher should not have this effect, but third-party ones, or home screen shortcuts, will.
Related
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
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>
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
<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.
With everything checked, when I create a new activity two manifest tags are created automatically and it shows an error. Should I uncheck something when creating a new activity before clicking finish in the preview section? My manifest code is below:
<<<<<<< Original
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.iamtheonewhoknocks.toolkit"
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.iamtheonewhoknocks.toolkit.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.iamtheonewhoknocks.toolkit.FlashlightActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/title_activity_flashlight"
android:parentActivityName="com.iamtheonewhoknocks.toolkit.MainActivity"
android:theme="#style/FullscreenTheme" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.iamtheonewhoknocks.toolkit.MainActivity" />
</activity>
</application>
</manifest>
=======
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<application>
<activity android:name=".FlashlightActivity"
android:label="#string/title_activity_flashlight"
>
</activity>
</application>
</manifest>
>>>>>>> Added
Those <<<<<<< Original and other tags were created automatically. Why is it doing this?
<intent-filter>
<action android:name="android.intent.FlashLight." />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
I don't know what IDE you are using ~ I am going to assume the Eclipse IDE Android bundle. When you create a new activity in the android manifest you need an intent filter within the activity xml files. So when you call a new activity in the src java files. You should have something like the code above in yours, but the 'FlashLight' at the end of android:name can be anything you want as long as you remember it and it makes sense. This is what seems to be missing from your code.
A quick work around would be to delete everything but:
<activity
android:name="com.iamtheonewhoknocks.toolkit.FlashlightActivity"
android:label="#string/title_activity_flashlight"
</activity>
and then add in that snippet of code at the top.
<activity
android:name="com.iamtheonewhoknocks.toolkit.FlashlightActivity"
android:label="#string/title_activity_flashlight"
<intent-filter>
<action android:name="android.intent.FlashLight." />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Hope this helps
I dont know a lot of English, but I have a big problem. I install my application and I can see the application icon when I look for it, but when I go to the uninstall menu, or in the notification bar, the icon doesnt appear.
Here are some photos of that problem.
https://www.dropbox.com/s/h80w3ztp9ex36rw/2013-12-09%2020.56.03.png
https://www.dropbox.com/s/v69il8ai5oinkvm/2013-12-09%2000.44.58.png
I can write my AndroidManifest, it's this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Podometro"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="com.Podometro.HiScreen"
android:screenOrientation="portrait"
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.Podometro.Pedometer"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:exported="true"
>
</activity>
<activity android:name="com.Podometro.CrearArchivo"
android:screenOrientation="portrait"> </activity>
<activity android:name="com.Podometro.Twitear"
android:screenOrientation="portrait"> </activity>
<activity android:name="com.Podometro.TwitterWebActivity"
android:screenOrientation="portrait"> </activity>
<activity android:name="com.Podometro.Constants_Settings" > </activity>
<service android:enabled="true"
android:name="com.Podometro.TheService">
</service>
</application>
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
Thanks for your help.
I'm not sure what is that uninstaller but I'd make sure to check it doesn't happen with other applications too.
Also verify you've got a version of your icon for all standard size versions. (drawable, drawable-hdpi, drawable-ldpi, etc.)
Buena suerte ;)
I'm having problems with setting my launcher icon from my android app.
As you can see, i've named the logo logodoor.png in the folder drawable (too in drawable hdpi, ldpi, etc.), and in AndroidManifest.xml drawable/logodoor
When starting up the app, it won't show the right launch icon, but the standard no-icon-android-icon.
-> On the target device the icon isn't displayed good; like there is a logo for twitter too
thanks for your answer :)
Menno
Manifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.menno.ghlyceum" android:versionCode="1" android:versionName="1.0.4">
<uses-permission android:name="android.permission.INTERNET"/>
<application android:icon="#drawable/logodoor" android:label="Ghlyceum OB" android:theme="#android:style/Theme.Black.NoTitleBar" android:debuggable="false">
<activity android:name=".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=".Notes" />
<activity android:name=".Help"></activity>
<activity android:name=".Rooster"></activity>
</application>
</manifest>
are you sure you have something like this:
<application
android:icon="#drawable/logodoor"
............>
</application>
<application
android:icon="#drawable/logodoor"
android:label="#string/app_name" >
<activity
android:name="YourActivityname"
android:label="#string/title_activity_flash_file" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
This way you can put your my launcher icon in manifest.
Sometimes I've had to uninstall the app for the icon to change
<application android:icon="#drawable/icon"
android:label="#string/app_name"
I have exported an app with 3 activities (main, splash and another activity called "about") to an apk file. It works fine when tested on the emulator. After uploading to the Play Store and then downloading to my own phone, it installs fine on my phone. Good so far. However, the apk doesn't appear packaged - it's showing the separate activities and not starting with the splash screen as it did in the emulator. What could be the problem? It exported with no errors. When I was exporting, I gave the apk a name that was different than the package name in the manifest. Would this cause the problem? Here is the manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.spinner"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_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="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AboutActivity"
android:label="#string/title_activity_about" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Thank you for looking.
This intent-filter
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
tells Android launcher app to show icon associated with Activity this filter is attached to on its Launcher screen. When corresponding icon is tapped by user, launcher app starts that activity and your code is executed. You usually want one entry point in your application so edit your Manifest file and ensure only one Activity element uses it. In your case, I guess leave it for SplashActivity and remove from others. It should look like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.spinner"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_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="#string/title_activity_main" >
</activity>
<activity
android:name=".AboutActivity"
android:label="#string/title_activity_about" >
</activity>
</application>
</manifest>
I'd also get rid of android:label from <activity> elements (just leave for <application>)