When I specify the .main class as the launcher, it crashes on launch. So I made a new activity called launch that will be used to open the .main class. When I specify .launch as the LAUNCHER, the console tells me that no launcher activity was found.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.homework"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
<application android:label="#string/app_name"
android:theme="#style/AppTheme"
android:allowBackup="true">
<activity android:name=".launch"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.LAUNCH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".menu"
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=".list"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.LIST" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Change
<intent-filter>
<action android:name="android.intent.action.LAUNCH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
to
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Well, does the com.my.homework.launch class exist? Does it subclass Activity? Also, the action should still be <action android:name="android.intent.action.MAIN" />.
Related
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.qz">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher_round"
android:label="MyQuizz"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".LoginActivity" />
<activity android:name=".SplashActivity" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />
<activity android:name=".ScoreActivity" />
<activity android:name=".MainActivity" />
<activity android:name=".QuestionActivity" />
<activity android:name=".SetsActivity" />
<activity android:name=".OptionsActivity" />
<activity android:name=".CategoryActivity" />
<activity android:name=".RegisterActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I would like to change is so my register activity is the launcher activity
Try this, replace:
<activity android:name=".RegisterActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
with
<activity android:name=".RegisterActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".RegisterActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I am new to android so I want to change the starting of the application in android manifest but each time the application is stopped cs worked is that we must change the java codes aussie
here is the xml code:
<application
android:icon="#drawable/icon"
android:label="hello">
<activity
android:name=".activity.ServersActivity"
android:label="#string/app_name"
android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.AddServerActivity"
android:label="#string/add_server_label">
<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="irc"/>
</intent-filter>
</activity>
For setting the starting activity, you'll have to add the following Intent Filter to the activity in your AndroidManifest.xml:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Please note that you should only add this Intent Filter to one of your Activities. Otherwise, you might experience unexpected behaviours.
There is no way to change the starting activity by code.
Cut this line and paste it inside activity tag to whom you want as starting activity
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
For eg: Making AddServerActivity as stating activity
<activity
android:name=".activity.ServersActivity"
android:label="#string/app_name"
android:launchMode="standard">
</activity>
<activity
android:name=".activity.AddServerActivity"
android:label="#string/add_server_label">
<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 android:name="android.intent.category.BROWSABLE" />
<data android:scheme="irc"/>
</intent-filter>
</activity>
I am just learning how to program apps for android, so please bear with me. My original starting activity was called Menu.Java. When I tested the app on my phone, a launcher icon would show up and I could launch the app from it. I decided to add a different Activity for my start up, which is called Login.java. I changed the intents to .MAIN and .LAUNCHER and now my icon won't show up at all. I tried switching it back to the Menu.Java and that worked for a bit (but clicking the icon would load the Menu Activity, and I was wanting the Login Activity loaded), but now that doesn't even work.
EDIT: I have also removed all of the activities from the manifest except the .Login Activity. Did not work.
Here is my Manifest:
`
<application
android:icon="#+drawable/ic_squirrel"
android:label="#string/app_name" >
<activity android:name="com.example.advanced.Login" >
<intent-filter>
<action android:name="com.example.advanced.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Settings"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.InternalStore"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.INTERNALSTORE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Reading"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.READING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Passing"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.PASSING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Numbers"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.NUMBERS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
`
<activity android:name="com.example.advanced.Login" >
<intent-filter>
<action android:name="com.example.advanced.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Here change the <intent-filter> to
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Android-Installing to device using eclipse install two instance of same app at once-error
and it runs when just after installed using the eclipse but when I touch the once of the icon its not starting it shows me the android common error syaing unexpectedly stopped!! please help me??
This is the manifest I'm using(activities)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hunter99x"
android:icon="#drawable/icon"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".main" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".origine" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.origine" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity `enter code here`android:name=".Gameover" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LandingScreen" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.VIBRATE"/>
</manifest>
I think the issue is because you have repeated
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
this for 2 activities. Try removing this and declare just 1 acivity as your main. Tjis may solve your issue.
Try this code inside the activities and check if it works:
#Override
public void onBackPressed() {
finish();
System.exit(0);
}
My application installs, atleast according to Eclipse, as it should. Then it stops with the following in the console:
[2011-10-17 14:10:58 - AppName] Uploading AppName.apk onto device 'emulator-5554'
[2011-10-17 14:11:07 - AppName] Installing AppName.apk...
[2011-10-17 14:11:23 - AppName] Success!
[2011-10-17 14:11:24 - AppName] \AppName\bin\AppName.apk installed on device
[2011-10-17 14:11:24 - AppName] Done!
When i click the launcher icon i get a toast saying:
"Application is not installed on your phone"
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.qualifiedpath.appname"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity
android:name="com.qualifiedpath.appname.AppTitleScreenActivity"
android:label="label"
android:screenOrientation="portrait"
android:noHistory="false"
android:launchMode="standard">
</activity>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity
android:name=".GameScreenActivity"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".KeypadActivity"
android:screenOrientation="portrait"
android:excludeFromRecents="true">
</activity>
</application>
</manifest>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
you have put the above code out of activity tag.Put it inside activity tag.
change this
<activity android:name="com.qualifiedpath.appname.AppTitleScreenActivity"
android:label="label"
android:screenOrientation="portrait"
android:noHistory="false"
android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
you need to place intent filter inside the activity tag
use this code
<activity
android:name="com.qualifiedpath.appname.AppTitleScreenActivity"
android:label="label"
android:screenOrientation="portrait"
android:noHistory="false"
android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>