Android launches abnormal activity

Android does not work correctly when the application starts.

Manifest.xml:

<activity android:name="com.company.app.activities.RS_SplashScreenActivity" 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.company.app.activities.RS_PreviousLauncherActivity" android:label="@string/app_name" android:theme="@style/myTheme" > </activity> 

I added a new RS_SplashScreenActivity activity and set it as a launch activity. However, he tries to launch RS_PreviousLauncherActivity , which used to be launch activity, before adding RS_SplashScreenActivity .

I am sure that the android is choosing the wrong launch activity due to the following logs from the console.

Console:

 [2013-10-10 12:03:58 - app] Android Launch! [2013-10-10 12:03:58 - app] adb is running normally. [2013-10-10 12:03:58 - app] Performing com.company.app.activities.RS_PreviousLauncherActivity activity launch [2013-10-10 12:04:01 - app] Uploading app.apk onto device '5C78E6332221CD6A1' [2013-10-10 12:04:05 - app] Installing app.apk... [2013-10-10 12:04:12 - app] Success! [2013-10-10 12:04:12 - app] Starting activity com.company.app.activities.RS_PreviousLauncherActivity on device 5C78E6332221CD6A1 [2013-10-10 12:04:12 - app] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.company.app/.activities.RS_PreviousLauncherActivity } [2013-10-10 12:04:13 - app] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.company.app/.activities.RS_PreviousLauncherActivity } from null (pid=4530, uid=2000) not exported from uid 10084 [2013-10-10 12:04:13 - app] ActivityManager: at android.os.Parcel.readException(Parcel.java:1425) [2013-10-10 12:04:13 - app] ActivityManager: at android.os.Parcel.readException(Parcel.java:1379) [2013-10-10 12:04:13 - app] ActivityManager: at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1783) [2013-10-10 12:04:13 - app] ActivityManager: at com.android.commands.am.Am.runStart(Am.java:463) [2013-10-10 12:04:13 - app] ActivityManager: at com.android.commands.am.Am.run(Am.java:108) [2013-10-10 12:04:13 - app] ActivityManager: at com.android.commands.am.Am.main(Am.java:81) [2013-10-10 12:04:13 - app] ActivityManager: at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) [2013-10-10 12:04:13 - app] ActivityManager: at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235) [2013-10-10 12:04:13 - app] ActivityManager: at dalvik.system.NativeStart.main(Native Method) 

Any idea why this is happening?

Edit:

 public class RS_SplashScreenActivity extends Activity { // Splash screen timer private static int SPLASH_TIME_OUT = 3000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash_screen); new Handler().postDelayed(new Runnable() { @Override public void run() { // This method will be executed once the timer is over // Start your app main activity Intent i = new Intent(RS_SplashScreenActivity.this, RS_PreviousLauncherActivity.class); RS_SplashScreenActivity.this.startActivity(i); // close this activity RS_SplashScreenActivity.this.finish(); } }, SPLASH_TIME_OUT); } 

Edit: When I RS_PreviousLauncherActivity activity tag for RS_PreviousLauncherActivity , it detects the correct activity as a trigger, but when I add the activity tag again, then it starts to select the wrong activity.

Edit: I go to the logs in the console. Maybe this has something to do with my problem.

 [2013-10-09 10:27:04 - app] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class (org.apache.james.mime4j.message.Header$1) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. 

And one more thing, this same project works on another machine.

+7
android android-activity android-launcher
source share
7 answers

Right-click your project and choose Run As > Run Configurations .... In the dialog that appears, select " Run default action " on the Android tab:

Run Configurations Dialog

It was probably found on a machine that continues to run old activity that it accidentally starts this specific activity (second radio book).

+20
source share

Uninstall the application and install it again, sometimes appLauncher in your launcher stores the old link, I had a similar problem with the icon, I changed the application icon, but it seemed old.

0
source share

Clean up your project from Eclipse.

  • Menu-> Project-> Clear-> Select Project-> OK

It will clear the project and generate the binary again. after that install the application and check.

0
source share

Try the following:

 <application ..... android:theme="@style/myTheme" > <activity android:name="com.company.app.activities.RS_SplashScreenActivity" 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.company.app.activities.RS_PreviousLauncherActivity" > </activity> 
0
source share

You might want to make a screensaver in the traditional way ... So you know that this will work, see the link: How to create a screensaver

0
source share

Clean up the project or uninstall the application. However, this did not work, then delete the "gen" folder, and then clean the project and run it.

0
source share

Check the RS_SplashScreenActivity code. all the time interval and redirect to RS_PreviousLauncherActivity.

If this does not solve your problem, do onething

1: Right click on a project from eclipse

2: click Source

3: Then click Clear ..

4: Click Finish

5: Atlast after uninstalling the application from your device will reinstall it.

This may solve your problem.

Edited

Try the following:

 <application ..... android:theme="@style/myTheme" > <activity android:name="com.company.app.activities.RS_SplashScreenActivity" 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.company.app.activities.RS_PreviousLauncherActivity" > <intent-filter> <action android:name="com.company.app.activities.RS_PreviousLauncherActivity" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> 
-one
source share

All Articles