Is there a difference between starting an application from the OS or from adb
Posted
by
aruwen
on Stack Overflow
See other posts from Stack Overflow
or by aruwen
Published on 2012-07-10T14:50:51Z
Indexed on
2012/07/10
15:15 UTC
Read the original article
Hit count: 276
android
|android-intent
I do have a curious error in my application. My app crashes (don't mind the crash, I roughly know why - classloader) when I start the application from the OS directly, then kill it from the background via any Task Killer (this is one of the few ways to reproduce the crash consistently -> simulating the OS freeing memory and closing the application) and try to restart it again.
The thing is, if I start the application via adb shell using the following command:
adb shell am start -a android.intent.action.MAIN -n com.my.packagename/myLaunchActivity
I cannot reproduce the crash.
So is there any difference in how Android OS calls the application as opposed to the above call?
EDIT: added the manifest (just changed names)
<?xml version="1.0" ?>
<manifest android:versionCode="5" android:versionName="1.05" package="com.my.sample" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="7"/>
<application android:icon="@drawable/square_my_logo" android:label="@string/app_name">
<activity android:label="@string/app_name" android:name="com.my.InfoActivity" android:screenOrientation="landscape"></activity>
<activity android:label="@string/app_name" android:name="com.my2.KickStart" android:screenOrientation="landscape"/>
<activity android:label="@string/app_name" android:name="com.my2.Launcher" android:screenOrientation="landscape">
<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.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/></manifest>
starting the com.my2.Launcher from the adb shell
© Stack Overflow or respective owner