English 中文(简体)
我的应用程序在Honeycomb上启动了两次
原标题:My application launchs twice on Honeycomb

When I execute my application on Honeycomb it gets launched twice.. I have place a breakpoint in the launcher Activity, in the onCreate() method, and although there is only one running process, the debugger stops twice on the breakpoint and there is two visible applications running on my tablet, one rear the other.

蜂窝里有人经历过这样的事情吗?有什么见解吗?

这是日志,请注意对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
最佳回答

你的应用程序是否仅限于人像,而你在平板电脑上运行它(默认情况下是横向的),如果是,这就是原因。

问题回答

我正在开发一款带有键盘底座的华硕Eee Pad Transformer。我注意到,当你在一个添加了OnEditorActionListener()的表单上按Enter键时,它会被调用两次!

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

因此,我添加了<code>clickedIme</code>布尔标志来抑制第二个<code>单击LogIn()</code〕调用。请注意,当<code>clickedIme</code>失败时,您必须将其重置为false,这样您就不会再按下Enter键。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签