Wrong Activity Launching On Start up Android - 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>

Related

No resource found that matches the given name (at 'icon' with value ....)

I'm making an android application in eclipse, and I want to upload it to the Google Play store. How ever, the store says that I need to add an Icon to it. I programmed the icon, but it gives the following error:
error: Error: `No resource found that matches the given name (at 'icon' with value '#drawable-hdpi/ic_launcher')`.
I have no idea how to fix it, the image is in my drawable-hdpi folder and is spelled correctly and everything.
Can someone help me out?
This is my AndoidManifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rodekruis"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:icon="#drawable-hdpi/ic_launcher" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.DEFAULT" />
<category android:name="android.intent.category.MAINACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".BezoekActivity"
android:label="#string/title_activity_bezoek" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.BEZOEKACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".AfspraakActivity"
android:label="#string/title_activity_afspraak" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.AFSPRAAKACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".ContactActivity"
android:label="#string/title_activity_contact" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.CONTACTACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".MeningActivity"
android:label="#string/title_activity_mening" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.MENINGACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".RouteActivity"
android:label="#string/title_activity_route" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.ROUTEACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".SpecialistenActivity"
android:label="#string/title_activity_specialisten" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.SPECIALISTENACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".BWCActivity"
android:label="#string/title_activity_bwc" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.BWCACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".AgendaActivity"
android:label="#string/title_activity_agenda" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.AGENDAACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".InfoActivity"
android:label="#string/title_activity_informatie" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.INFOACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".VriendActivity"
android:label="#string/title_activity_vriend" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.VRIENDACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".FoldersActivity"
android:label="#string/title_activity_folders" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.FOLDERSACTIVITY" />
</intent-filter>
</activity>
<activity
android:name=".NieuwsActivity"
android:label="#string/title_activity_nieuws">
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.NIEUWSACTIVITY" />
</intent-filter>
</activity>
</application>
</manifest>
Try this android:icon="#drawable/ic_launcher" in the applicaiton node. The system will automatically choose the right drawable folder (hdpi, xhdpi, ...) according to the pixel density of the device which run the application.
mistake is in the below line
android:icon="#drawable-hdpi/ic_launcher"
instead use
android:icon="#drawable/ic_launcher"
it will automatically pick up its best
Change the below snippet
android:icon="#drawable-hdpi/ic_launcher"
to
android:icon="#mipmap/ic_launcher"
Change
android:icon="#drawable-hdpi/ic_launcher"
to
android:icon="#drawable/ic_launcher"

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>

No Launcher Activity Found even though there is [duplicate]

This question already has answers here:
No Launcher activity found
(2 answers)
Closed 9 years ago.
This is a copy of my AndroidManifest.xml
Any help as to why the launcher is not being recognized? I tried running the code without applying DEFAULT to any other activity but it's still not working.
enter code here
<application
<activity
android:name="project.shirsho.Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="project.shirsho.MENU" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="project.shirsho.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="project.shirsho.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="project.shirsho.Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="project.shirsho.Textplay"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.TEXTPLAY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
You need to specify the MAIN and LAUNCHER in the the intent filter for the activity you want to start on launch by :
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
if you want that Splach Activity as your launcher , your manifest must be :
<application>
<activity
android:name="project.shirsho.Menu"
android:label="#string/app_name" >
</activity>
<activity
android:name="project.shirsho.MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="project.shirsho.Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="project.shirsho.Textplay"
android:label="#string/app_name" >
</activity>
</application>
I believe that you are trying to make "project.shirsho.Menu" as the launcher activity, then it should be like:
<activity
android:name="project.shirsho.Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
change,
<intent-filter>
<action android:name="project.shirsho.MENU" />
to
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Hope this helps! :)
This is how your application part should look like. If you use eclipse to develop in it will help you create this (androidManifest.xml)
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<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=".SplashActivity"
android:label="#string/app_name" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

How can i use android.intent categories more than one?

Like this: (This is broke)
<activity
android:name="com.example.Main"
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.IKI"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.MAINIKI" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.UC"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.MAINUC" />
<category android:name="android.intent.category.**DEFAULT**" />
</intent-filter>
</activity>
Problem is the bold code. How can i use that activity? What is other categories that are choosable? Is there? What should i do?
you may use different activity when you have more than one main activity class in your project.

Help on Tab Layout example

New bee to Android, I need help on creating tabs.
I am following the example stated in http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
When I run the application, I am not seeing any tabs but only Songs tab.
I am not able to figure out how to resolve this.
Below code is added under AndriodManifest.xml
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloTabWidget"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".AlbumsActivity">
<intent-filter>
<action android:name="com.example.TabWidget.AlbumsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".ArtistsActivity">
<intent-filter>
<action android:name="com.example.TabWidget.AlbumsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".SongsActivity">
<intent-filter>
<action android:name="com.example.TabWidget.AlbumsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
Make it look something like this:
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloTabWidget"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AlbumsActivity"/>
<activity android:name=".ArtistsActivity"/>
<activity android:name=".SongsActivity"/>
</application>
This part:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
is for the entry part of your app.
here is a very simple example for tab-layout:
Andorid Tab-Layout with icons

Categories

Resources