No launcher in manifest? - android

I have 2 activity, I want to run one first. If I run this code, Console will write this: No Launcher activity found!, but i declared LAUNCHER in manifest?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.manif"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<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="com.example.manif.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> //<--here is a problem, i think
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.manif.SECOND_CLASS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>

Change the action name to :
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

try to replace this
<intent-filter>
<action android:name="com.example.manif.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
with this
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Don't use intent filter and other thing second time-
<activity
android:name=".MainActivity"
android:label="#string/app_name" />
This code is enough for second activity.

just remove tag:
<action android:name="com.example.manif.SECOND_CLASS" />

Related

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>

Android Emulator Always on Landscape

I would like to ask why is that my android emulator always displays on landscape even though I have a android:orientation="horizontal" on my code here is my screenshot
and when I change it to portrait mode using ctrl + f11 it is still on landscape mode.
Android Manifest
`
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<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=".Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Calculation"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.CALCULATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Instruction"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.INSTRUCTION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Tips"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.TIPS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".BillingCenter"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.BILLINGCENTER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".AboutUs"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.ABOUTUS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>`
XML File
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/background2"
android:screenOrientation="portrait" >
Please try replacing "horizontal" with "portrait". If that doesn't work please post your manifest, or at least the activity part of it. Note that this is an activity-specific attribute, not application. If you want all your activities to have one specific orientation you need to set this attribute in each one in the manifest.
Good luck!
Have you use the Google APIs with the Emulator, you can try to change the Google APIs to normal Android API. May the two answers help you

Eclipse: Android: Can't Chance Launcher Activity

I just started an Android Project and i made a Splash.png and Splash Activity for my App, with the Splash.xml, and the Splash.java with the onCreate Method and the setContentView, I also change the Intent in the manifest so the Splash would be the LAUNCHER.
BUT the "MainActivity" is still default launcher, I cant change that.
And if I try to Clean up my proyect, Eclipse just wipes out everying I modified from the
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.learn.xandroix"
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.learn.xandroix.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="com.learn.xandroix.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
This is what the Eclipse Console is showing:
[2013-07-22 11:28:56 - XAndroiX] Installing XAndroiX.apk...
[2013-07-22 11:29:06 - XAndroiX] Success!
[2013-07-22 11:29:07 - XAndroiX] Starting activity com.learn.xandroix.MainActivity on device S5830f33ed19b
[2013-07-22 11:29:09 - XAndroiX] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.learn.xandroix/.MainActivity }
Try this:
<?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.learn.xandroix.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="com.learn.xandroix.MainActivity">
</activity>
</application>
Cheers
Chnage this in you manifest.xml file
<activity
android:name="com.learn.xandroix.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="MainActivity">
</activity>
Consider this;
<activity
android:name="com.learn.xandroix.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="com.learn.xandroix.MainActivity"
android:label="#string/app_name" >
</activity>
Try this way:
Just care "action android:name" of 2nd activity.
Enjoy :)
<activity
android:name="com.learn.xandroix.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="com.learn.xandroix.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.learn.xandroix.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Change order of activity to open first

I am working on a project, where i have 4 activities. Each time i run the project, activityA opens first and then other activities, but i want that the MainActivity should open first and then other activities.
Where should i define the order of activities to open.
Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.it"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".ActivityA"
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 android:name=".GeneralAct" />
<activity android:name=".BackUp" />
<activity android:name=".AccountSettings" />
</application>
</manifest>
You need
<category android:name="android.intent.category.LAUNCHER" />
within the activity tag for MainActivity.
<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>
Define MainActivity as,
<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>
and all other activities as,
<activity
android:name=".ActivityA"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Launcher Activity is opened first and then the Default Activities.
Just Replace your manifest with this code..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.it"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".ActivityA"
android:label="#string/app_name" >
</activity>
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".GeneralAct" />
<activity android:name=".BackUp" />
<activity android:name=".AccountSettings" />
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".yourmainactivityname"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Activity1 -->
<activity android:name=".Activity1" />
<!-- Activity2 -->
<activity android:name=".Activity2 " />
<!-- Activity3 -->
<activity android:name=".Activity3 " />
<!-- Activity4 -->
<activity android:name=".Activity4" />
</application>
The Activity you want to open first must have a intent filter with category description as:
<category android:name="android.intent.category.LAUNCHER"/>
Here is the complete Activity declaration in Android Menifest:
<activity
android:name=".MainActivity"
android:theme="#style/app_theme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Application title is not showing in menu

Only the application icon is displayed. I am providing my manifest code and also I have kept my main launcher activity and project name the same, SHPOONKLE.
Please help me. Thanks in advance.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.avigma.shpoonkle"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:label="#string/app_name"
android:name=".SHPOONKLEActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Test" android:launchMode="singleTask" android:theme="#android:style/Theme.NoTitleBar">
<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="x-marakana-oauth-twitter"
android:host="callback" />
</intent-filter>
</activity>
<activity android:name=".ShpoonkleActivity1" android:theme="#android:style/Theme.NoTitleBar"></activity>
<activity android:name=".ShareOnFacebook" android:screenOrientation="portrait" android:theme="#android:style/Theme.Dialog"></activity>
<activity android:name=".Twett" android:screenOrientation="portrait" android:theme="#android:style/Theme.Dialog"></activity>
</application>
</manifest>
Please check #string/app_name for your application. I suppose it is having blank value.

Categories

Resources