Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid launching wrong activity
    primarykey
    data
    text
    <p>Android is launching wrong activity when I start app.</p> <p><strong>Manifest.xml :</strong></p> <pre><code>&lt;activity android:name="com.company.app.activities.RS_SplashScreenActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.company.app.activities.RS_PreviousLauncherActivity" android:label="@string/app_name" android:theme="@style/myTheme" &gt; &lt;/activity&gt; </code></pre> <p>I added a new Activity <code>RS_SplashScreenActivity</code> and set it as launcher activity. Still it tries to launch <code>RS_PreviousLauncherActivity</code> which used to be a launcher activity before adding <code>RS_SplashScreenActivity</code>.</p> <p>I am sure that android chooses wrong launcher activity on account of below logs from console.</p> <p><strong>Console :</strong></p> <pre><code>[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) </code></pre> <p>Any idea why this happens?</p> <p><strong>Edit :</strong></p> <pre><code>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); } </code></pre> <p><strong>Edit :</strong> When I remove activity tag for <code>RS_PreviousLauncherActivity</code>, it detects correct activity as launcher but when I add activity tag again then it starts selecting wrong activity.</p> <p><strong>Edit :</strong> I get below logs in console. May be this has something to do with my problem.</p> <pre><code>[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. </code></pre> <p>And one more thing, this same project works on other machine.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload