How to make default android Launcher - android

I am trying to create a launcher application and I did it fine.
but there is a problem with my launcher:
When I choose it as default launcher for a device with pressing back button of device my launcher will disappear and last default launcher will appear!
this is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<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.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AppsListActivity"/>
</application>
Thank you for your help.

<activity
android:name="ah.hathi.simplelauncher.HomeActivity"
android:label="Simple Launcher Home"
android:theme="#android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"
>
<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>
do it like this hope this will work for you

Related

Can't find launch activity

I removed these 2 lines from my android manifest file. Then I found them in internet and paste it to manifest file. And now my app can't find them. When I run my app says that there is no launcher activity and that may be I want to launch default activity.What can I do?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.amadey.myapplication3" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</intent-filter>
</activity>
<activity
android:name=".HomeScreen">
</activity>
</application>
</manifest>
You have a doubly-nested intent-filter element in your manifest:
<intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</intent-filter>
It needs to look like this:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Because an intent filter was surrounded with another intent filter, just like this:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Android Studio doesn't install app with launcher, app only visible in app settings

Android Studio doesn't install app properly. It's not visible in the apps launcher. Already tried to keep only MAIN and LAUNCHER intent filter.
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".App">
<activity
android:name=".ui.main.MainActivity"
android:label="#string/title_activity_navigation_drawer" >
<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>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="mainactivity" />
</intent-filter>
</activity>
<activity android:name=".ui.web.WebViewActivity"/>
</application>
The solution was to define intent filters seperately:
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".App">
<activity
android:name=".ui.main.MainActivity"
android:label="#string/title_activity_navigation_drawer" >
<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>
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="mainactivity" />
</intent-filter>
</activity>
<activity android:name=".ui.web.WebViewActivity"/>
</application>
Example in android documentation

Wrong Activity Launching On Start up Android

When i start my app it launches the wrong activity, i am new to coding so if you could keep the answer as simple as possible and tell me where i was going wrong it would be great, thanks in advance
This is my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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=".Dust2"
android:label="#string/title_activity_dust2" >
<intent-filter>
<action android:name="csgosmokes.csgo.dust2" />
<category android:name="android.intent.category.default" />
</intent-filter>
</activity>
</application>
Remove
<intent-filter>
<action android:name="csgosmokes.csgo.dust2" />
<category android:name="android.intent.category.default" />
</intent-filter>
From
<activity
android:name=".Dust2"
android:label="#string/title_activity_dust2" >
<intent-filter>
<action android:name="csgosmokes.csgo.dust2" />
<category android:name="android.intent.category.default" />
</intent-filter>
</activity>

My app icon does not appear in the emulator home screen

I want specific ordered reasons why my app icon does not appear, I can run it on the emulator yet and I need to know what's wrong with my app? I'm a beginner my code is so simple, though I can't find why is this happening.
Here is my manifest:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Splash"
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=".MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.example.hp.app2.MyActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
Instead of
<category android:name="android.intent.category.launcher" />
it must be
<category android:name="android.intent.category.LAUNCHER" />

Android development manifest

Hi I'm making an android app for the first time and I am stuck I have made a main menu with buttons and I want it to go to another secondary menu for example console games gets clicked and then goes to the console menu view then from there click on the PlayStation button to get to Google maps. The problem is when I get to the console menu the buttons do nothing even when I have the onclicklistener method set to the right button. I have narrowed it down (I think) to the manifest where the problem is but I can't find what is wrong. Here is the whole code .Please Help thanks. :)
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:icon="#drawable/gf_icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar"
android:debuggable="true">
<uses-library android:name="com.google.android.maps" />
<!--splash screen-->
<activity
android:name=".myMain"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- main screen -->
<activity
android:name=".myMenu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.irou.geekfast.CLEARSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- console games menu -->
<activity
android:name=".consoleGames"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.irou.geekfast.CONSOLEGAMES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- console games menu -->
<activity
android:name=".consoleGames"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.irou.geekfast.CONSOLEGAMES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- hardware menu -->
<activity
android:name=".mainMenu"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.irou.geekfast.MAINMENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".helpBox"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog">
<intent-filter>
<action android:name="com.irou.geekfast.HELPBOX" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Map activity -->
<activity
android:name=".consoleMap"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.irou.geekfast.CONSOLEMAP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
From the information you have provided looks like you are missing Intent Filters
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Categories

Resources