我的应用程序在Honeycomb上发布了两次

时间:2011-05-26 09:32:57

标签: android android-3.0-honeycomb launch dalvik

当我在Honeycomb上执行我的应用程序时,它会启动两次.. 我在onCreate()方法的启动器Activity中放置了一个断点,虽然只有一个正在运行的进程,但调试器在断点处停止了两次,我的平板电脑上运行了两个可见的应用程序,一个在另一个后面。< / p>

在Honeycomb中有人遇到类似这样的事情吗?任何见解?

这是日志,关于对LoadingActivity.OnCreate()的两次调用的注意事项。

 
05-25 15:59:08.900: INFO/System.out(28656): Sending WAIT chunk
05-25 15:59:08.900: WARN/ActivityThread(28656): Application net.XXXX.android is waiting for the debugger on port 8100...
05-25 15:59:09.080: INFO/dalvikvm(28656): Debugger is active
05-25 15:59:09.100: INFO/System.out(28656): Debugger has connected
05-25 15:59:09.100: INFO/System.out(28656): waiting for debugger to settle...
                                    ...
05-25 15:59:10.700: INFO/System.out(28656): waiting for debugger to settle...
05-25 15:59:10.900: INFO/System.out(28656): debugger has settled (1454)
05-25 15:59:11.570: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)

// ------------------------------------------------------------------------------------------------------
// First call to my launcher Activity
--->> 05-25 15:59:18.040: VERBOSE/SplashActivity(28656): LoadActivity.onCreate()
                                    ...
05-25 15:59:18.110: DEBUG/dalvikvm(28656): GC_FOR_ALLOC freed 100K, 4% free 6393K/6599K, paused 15ms                                    
05-25 15:59:18.180: DEBUG/szipinf(28656): Initializing inflate state
05-25 15:59:18.190: DEBUG/szipinf(28656): Initializing zlib to inflate
05-25 15:59:18.330: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:18.360: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:18.360: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 63K, 4% free 6770K/6983K, paused 1ms+1ms
05-25 15:59:18.940: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:18.960: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:18.960: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 278K, 6% free 6943K/7367K, paused 1ms+2ms
05-25 15:59:19.500: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:19.510: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:19.510: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 327K, 7% free 7021K/7495K, paused 2ms+2ms
05-25 15:59:20.090: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:20.130: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:20.130: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 350K, 7% free 7128K/7623K, paused 1ms+2ms
05-25 15:59:20.640: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:20.680: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:20.680: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 339K, 7% free 7200K/7687K, paused 1ms+2ms
05-25 15:59:21.180: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:21.190: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:21.200: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 324K, 7% free 7281K/7751K, paused 2ms+2ms
05-25 15:59:21.810: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:21.850: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:21.850: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 341K, 7% free 7394K/7879K, paused 1ms+2ms
05-25 15:59:22.380: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:22.410: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:22.410: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 343K, 7% free 7456K/7943K, paused 1ms+2ms
05-25 15:59:22.880: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:22.900: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:22.900: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 325K, 6% free 7541K/8007K, paused 1ms+2ms
                                    ...
05-25 15:59:23.620: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
                                    ...
05-25 15:59:23.640: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 15:59:23.640: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 350K, 7% free 7628K/8135K, paused 1ms+2ms

// ------------------------------------------------------------------------------------------------------
// Second call to my launcher Activity
--->> 05-25 16:01:56.620: VERBOSE/SplashActivity(28656): LoadActivity.onCreate()
                                    ...
05-25 16:04:33.260: DEBUG/szipinf(28656): Initializing inflate state
05-25 16:04:33.260: DEBUG/szipinf(28656): Initializing zlib to inflate
05-25 16:04:33.750: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:33.780: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:33.780: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 382K, 7% free 7674K/8199K, paused 1ms+2ms
05-25 16:04:34.360: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:34.390: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:34.390: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 429K, 7% free 7691K/8263K, paused 2ms+2ms
05-25 16:04:34.960: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:34.970: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:34.980: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 434K, 7% free 7686K/8263K, paused 1ms+2ms
05-25 16:04:35.520: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:35.550: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:35.550: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 434K, 7% free 7687K/8263K, paused 1ms+2ms
05-25 16:04:36.100: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:36.120: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:36.120: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 433K, 7% free 7686K/8263K, paused 2ms+2ms
05-25 16:04:36.720: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:36.760: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:36.760: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 426K, 7% free 7693K/8263K, paused 1ms+2ms
05-25 16:04:37.330: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:37.350: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:37.350: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 437K, 7% free 7686K/8263K, paused 1ms+2ms
05-25 16:04:37.880: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:37.910: DEBUG/dalvikvm(28656): threadid=1: still suspended after undo (sc=1 dc=1)
05-25 16:04:37.910: DEBUG/dalvikvm(28656): GC_CONCURRENT freed 434K, 7% free 7689K/8263K, paused 1ms+3ms

2 个答案:

答案 0 :(得分:2)

您的应用是否仅限于肖像,并且您在平板电脑上运行它(默认为横向),如果是这样,这就是原因。

答案 1 :(得分:0)

我正在使用键盘底座开发华硕Eee Pad变压器。我注意到当你在表单上按Enter键时,你已经添加了OnEditorActionListener(),它会被调用两次!

    etPassWord.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (!clickedIme) {
                clickLogIn();
                clickedIme = true;
            }
            return true;
        }
    });

所以我添加了clickedIme布尔标志来抑制第二个clickLogIn()调用。请注意,如果失败,您必须将clickedIme重置为false,这样您就不会进一步抑制Enter press。