Android app doesn't load up on the emulator - android

My app has no errors in it however when i come to run it on the emulator then the emulator runs but doesn't show my app and comes up with this
error message -
[2013-03-15 09:47:57 - Writees] No Launcher activity found!
[2013-03-15 09:47:57 - Writees] The launch will only sync the
application package on the device!
This is my manifest -
?xml version="1.0" encoding="utf-8"?>
android:allowBackup = "True">
<activity
android:name="com.example.writees.LoginActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</intent-filter>
</activity>
<!-- dashboard Activity -->
<activity
android:name="com.example.writees.DashboardActivity"
android:label="dashboard" >
</activity>
<!-- main Activity -->
<activity
android:name="com.example.writees.MainActivity"
android:label="main" >
</activity>
<!-- Register Activity -->
<activity
android:name="com.example.writees.RegisterActivity"
android:label="Register New Account" >
</activity>
<!-- Book Activity -->
<activity
android:name="com.example.writees.BookActivity"
android:label="book" >
</activity>
/>

No Launcher activity found!
You did not set any activity as a Launcher in AndroidManifest.xml
<activity android:name=".ExampleActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

You have to make any one activity that you want to launch first as Launcher activity.
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.helloworld.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>

Related

Trouble understanding how to set my login activity to the launcher activity in the Android manifest

I want to change my manifest so that the Login Activity is the first activity to start on the phone. The login activity checks the sharedpreferences to see if a user has login info saved. If they do it logs them in. Im pretty sure I need an intent-filter in login activity with <category android:name="android.intent.category.LAUNCHER" /> but I dont get what I should put for the action.
Heres my manifest
<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>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".DisplayMessageActivity"
android:label="#string/title_activity_display_message"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.incubatorcle.dinahealth.MainActivity" />
</activity>
<activity
android:name=".UserOnboardActivity"
android:label="#string/title_activity_user_onboard" >
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login" >
</activity>
</application>
You need:
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
ACTION_MAIN action indicates this is the main entry point and does
not expect any intent data.
CATEGORY_LAUNCHER category indicates
that this activity's icon should be placed in the system's app
launcher.
Your MainActivity need to look like this:
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.yourpacgagename.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Your Login activity need to look like this:
<activity
android:name=".LoginActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
As your question is answered by #wariaten
Here is another way to do the login check
Add a third activity (where you check the SharedPreferences and launch the LoginActivity or the HomeActivity) and set it as the launcher as suggested by #wariaten

Android console error show No activity specified! Getting the launcher activity

I recently have changed my app little bit. And it now generate these in console
[2013-12-05 14:37:28 - Citytouch] Android Launch!
[2013-12-05 14:37:28 - Citytouch] adb is running normally.
[2013-12-05 14:37:28 - Citytouch] No activity specified! Getting the launcher activity.
But this error does not effect my app,it works fine.I am concerned about this error if it causes any further severe error in future.I search this
link But it does not help me.
My manifest file is....
<application
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.thecitybank.citytouch.SplashActivity"
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.thecitybank.citytouch.Tabactivty"
android:screenOrientation="portrait" />
<activity
android:name="com.thecitybank.citytouch.ParticularMapactivity"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.thecitybank.citytouch.NotificationActivity"
android:excludeFromRecents="true"
android:screenOrientation="portrait" >
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.thecitybank.citytouch" />
</intent-filter>
</receiver>
<service android:name="com.thecitybank.citytouch.GCMIntentService" />
<service android:name="com.thecitybank.citytouch.GpsTracker" >
</service>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDrnKNJF3nWMs-MDseo5LE34UhMg195weo" />
<!-- relese: android:value="AIzaSyDLmr8GZu9LP1l5fTEze1meET5d1h5kKlQ" -->
<!-- android:value="AIzaSyCea8B9EuvTj1k9KBkbukyHgstRzbBz9vI" -->
</application>

How To set UP Activities in Manifest

<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".precus"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="com.yair.guessit.PRECUS" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="Customize"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="FirstPage"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="com.yair.guessit.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
this is my manifest up there, and the app dont open .
can someone explain me how to set up the manifest with all the activites?
the precus is the first for now to open when the app open.
at the precus activity there is a intent that when the button get clicked its Customize activity.
why its not working?
change this line in your file
<action android:name="com.yair.guessit.PRECUS" />
to
<action android:name="android.intent.action.MAIN"/>
then run it.
if it work fine. then mark it as an accepted answer.
Your application has all Activities with intent-filter .Main... Let only one to have this filter, in others - just delete intent-filteres like...
<activity
android:name="FirstPage"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>

Android App has more than one launcher

So I have an app, with 2 activities. For some reason I am getting 2 launcher icons, one for each activity, but I only want one!
The Game activity had an intent-filter which i removed. I also uninstalled the app and reinstalled it from scratch but its still coming up with both launchers :(
Manifest below
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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=".Game"
android:label="#string/title_activity_game" >
</activity>
</application>
You need to remove the label tag from your second Activity.
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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=".Game" >
</activity>
</application>

App Unable to Find Launcher Activity

I have just started to develop a brand new application and I have two Activities set up one which displays the Splash Screen and another the Main one. Here is the manifest file:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".Main"
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=".Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SPLASH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I tried changing android.intent.action also removing the DEFAULT Category line from Main also placing the Splash Activity setup above main.
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".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=".Splash"
android:label="#string/app_name" >
</activity>
</application>
Just realized the .MAIN in action and .LAUNCHER should be in the same activity , it's working now!
check this
Android: No Launcher activity found! was working before

Categories

Resources