我已经有一段时间没有得到这个例外了。我没有注意到它阻止了任何功能,但是我不希望在后台进行部署,以防它导致更大的问题。有没有人知道这意味着什么?
来自Android日志:
09-06 08:14:45.562: I/ActivityManager(455): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.foo.main/.ui.config.InitialActivity} from pid 3435
09-06 08:14:45.582: I/ActivityManager(455): Start proc org.foo.main for activity org.foo.main/.ui.config.InitialActivity: pid=3447 uid=10091 gids={50091, 1028, 1015, 3003}
09-06 08:14:45.727: I/ActivityManager(455): START u0 {flg=0x4000000 cmp=org.foo.main/.ui.LoginActivity} from pid 3447
09-06 08:14:45.757: E/ActivityManager(455): Trying to pause when pause is already pending for ActivityRecord{41e1de20 u0 org.foo.main/.ui.LoginActivity t6}
09-06 08:14:45.757: E/ActivityManager(455): java.lang.RuntimeException: here
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:726)
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityStack.checkReadyForSleepLocked(ActivityStack.java:657)
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityStackSupervisor.checkReadyForSleepLocked(ActivityStackSupervisor.java:2197)
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1600)
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityStackSupervisor.resumeTopActivitiesLocked(ActivityStackSupervisor.java:2022)
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityStack.completePauseLocked(ActivityStack.java:921)
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityStack.activityPausedLocked(ActivityStack.java:820)
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityManagerService.activityPaused(ActivityManagerService.java:5234)
09-06 08:14:45.757: E/ActivityManager(455): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:426)
09-06 08:14:45.757: E/ActivityManager(455): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2071)
09-06 08:14:45.757: E/ActivityManager(455): at android.os.Binder.execTransact(Binder.java:404)
09-06 08:14:45.757: E/ActivityManager(455): at dalvik.system.NativeStart.run(Native Method)
这是InitialActivity中唯一重要的代码,如果应用程序已初始化并注册,它只会重新路由到LoginActivity:
@Override
public void onResume() {
super.onResume();
ConfigInfoManager configInfoManager = new ConfigInfoManager(this);
switch(configInfoManager.getInitState()) {
...
case REGISTERED:
new ServiceManager(this).schedulePingRepeating();
Actions.loginScreen(this);
break;
}
}
public static void loginScreen(Activity context) {
Intent intent = new Intent(context, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
}
我认为它不相关,但在应用程序的随机位置,这段代码用于返回登录屏幕:
public static void logout(Activity context) {
Intent intent = new Intent(context, InitialActivity.class);
intent = Intent.makeRestartActivityTask(intent.getComponent());
context.startActivity(intent);
}
最后,以下是清单中的相关部分:
<activity android:name=".ui.config.InitialActivity" android:label="@string/app_name" android:noHistory="true" android:screenOrientation="landscape" android:theme="@android:style/Theme.Translucent.NoTitleBar" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".ui.LoginActivity" android:label="@string/app_login_name" android:screenOrientation="landscape" android:theme="@style/LoginTheme" android:windowSoftInputMode="adjustResize" > </activity>