I am having this problem.
I created a new xml layout (splash screen) and in manifest set it as Launcher category.
I did this before tons of time but it never happened before.
When MainActivity is LAUNCHER categpry and I run Spalsh Activity via intent it works.
Doing opposite I get error No launcher activity found.
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".SecondActivity"
android:label="Second Activity" >
<intent-filter>
<action android:name="net.learn2develop.SECONDACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<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>
</application>
No problem in this one, but if I modify it to
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".SecondActivity"
android:label="Second Activity" >
<intent-filter>
<action android:name="net.learn2develop.SECONDACTIVITY" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
I get error.
try with following
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".SecondActivity"
android:label="Second Activity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="net.learn2develop.SECONDACTIVITY" /> <!--(or android.intent.action.VIEW) -->
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
try this:
<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=".SecondActivity"
android:label="Second Activity" >
</activity>
</application>
Related
When I install the application on my phone , if I do not put the Main Activity as the LAUNCHER, then the application does not show up on my Home Screen.
<application
android:allowBackup="true"
android:icon="#mipmap/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<!-- This is the SplashScreen -->
<activity android:name=".SplashScreen"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
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=".SongList"
android:label="#string/app_name" >
</activity>
<activity
android:name=".DisplayLyrics"
android:label="#string/app_name" >
</activity>
</application>
I have two activities. When i mark my first activity as launcher(StartActivity) i get an error, but when i mark second activity(MainActivity) he works.
Here is code:
<application
android:allowBackup="true"
android:icon="#drawable/buisness"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="MainActivity"
android:label="#string/app_name" android:screenOrientation="portrait">
</activity>
<activity
android:name="StartActivity"
android:label="#string/title_activity_start" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
In this variant i get error.
<application
android:allowBackup="true"
android:icon="#drawable/buisness"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="MainActivity"
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="StartActivity"
android:label="#string/title_activity_start" android:screenOrientation="portrait">
</activity>
</application>
In this variant everything its OK.
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>
<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>
I have an error in my android code:
case R.id.bSQLOpenView:
Intent i = new Intent("com.fps.say.SQLView");
startActivity(i);
break;
and my logcat says there's no activity found to handle intent..
I already declared my class at AndroidManifest.xml why do i still get this error.
this is my manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fps.say"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<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.fps.say.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".SayActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.fps.say.SAYACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".TextPlay"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.fps.say.TEXTPLAY" />
</intent-filter>
</activity>
<activity
android:name=".Email"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.fps.say.EMAIL" />
</intent-filter>
</activity>
<activity
android:name=".Camera"
android:label="Camera Application"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.fps.say.CAMERA" />
</intent-filter>
</activity>
<activity
android:name=".AboutUs"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog">
<intent-filter>
<action android:name="com.fps.say.ABOUTUS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Prefs"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.PREFS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Data"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.DATA" />
</intent-filter>
</activity>
<activity
android:name=".GFX"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.GFX" />
</intent-filter>
</activity>
<activity
android:name=".GFXSurface"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.GFXSURFACE" />
</intent-filter>
</activity>
<activity
android:name=".OpenedClass"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.OPENEDCLASS" />
</intent-filter>
</activity>
<activity
android:name=".SoundStuff"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SOUNDSTUFF" />
</intent-filter>
</activity>
<activity
android:name=".Slider"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SLIDER" />
</intent-filter>
</activity>
<activity
android:name=".Tabs"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.TABS" />
</intent-filter>
</activity>
<activity
android:name=".SimpleBrowser"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SIMPLEBROWSER" />
</intent-filter>
</activity>
<activity
android:name=".SharedPrefs"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SHAREDPREFS" />
</intent-filter>
</activity>
<activity
android:name=".InternalData"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.INTERNALDATA" />
</intent-filter>
</activity>
<activity
android:name=".ExternalData"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.EXTERNALDATA" />
</intent-filter>
</activity>
<activity
android:name=".SQLView"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SQLVIEW" />
</intent-filter>
</activity>
<activity
android:name=".SQLiteExample"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SQLITEEXAMPLE" />
</intent-filter>
</activity>
</application>
</manifest>
There are several possible ways to run an activity.
Here's the method I use:
Intent i = new Intent (this, YourTargetActivity.class);
startActivity(i);
The this corresponds to your current activity.
Using such a call gives you the convenience to have your IDE autocomplete the desired activity name.
Dubble check the name of the class
Dubble check the name which should be mentioned in the manifest file
Perform a clean-build
Intent i = new Intent(this,SQLVIEW.class);