1

我试图将启动画面设置为 5 秒,然后打开另一个意图,但我认为模拟器迷恋是因为启动画面 layout.xml

09-23 11:21:22.135: W/EGL_emulation(2204): eglSurfaceAttrib not implemented
09-23 11:21:22.605: I/Process(2204): Sending signal. PID: 2204 SIG: 9
09-23 11:21:31.805: D/dalvikvm(2222): GC_FOR_ALLOC freed 66K, 8% free 2583K/2780K, paused 2ms, total 4ms
09-23 11:21:31.805: I/dalvikvm-heap(2222): Grow heap (frag case) to 4.549MB for 1997580-byte allocation
09-23 11:21:31.825: D/dalvikvm(2222): GC_FOR_ALLOC freed 2K, 5% free 4531K/4732K, paused 2ms, total 2ms
09-23 11:21:31.955: W/dalvikvm(2222): threadid=11: thread exiting with uncaught exception (group=0xb2ef8648)
09-23 11:21:31.955: E/AndroidRuntime(2222): FATAL EXCEPTION: Thread-105
09-23 11:21:31.955: E/AndroidRuntime(2222): java.lang.IllegalMonitorStateException: object not locked by thread before wait()
09-23 11:21:31.955: E/AndroidRuntime(2222):     at java.lang.Object.wait(Native Method)
09-23 11:21:31.955: E/AndroidRuntime(2222):     at java.lang.Object.wait(Object.java:401)
09-23 11:21:31.955: E/AndroidRuntime(2222):     at com.app.locator.Splash$1.run(Splash.java:19)
09-23 11:21:31.995: D/libEGL(2222): loaded /system/lib/egl/libEGL_emulation.so
09-23 11:21:31.995: D/(2222): HostConnection::get() New Host Connection established 0xb9481bf0, tid 2222
09-23 11:21:32.025: D/libEGL(2222): loaded /system/lib/egl/libGLESv1_CM_emulation.so
09-23 11:21:32.025: D/libEGL(2222): loaded /system/lib/egl/libGLESv2_emulation.so
09-23 11:21:32.255: W/EGL_emulation(2222): eglSurfaceAttrib not implemented
09-23 11:21:32.295: D/OpenGLRenderer(2222): Enabling debug mode 0
09-23 11:21:32.945: W/EGL_emulation(2222): eglSurfaceAttrib not implemented
4

1 回答 1

0

看来您的启动画面使用了太大的位图。尝试缩小它。例子:

    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    //get splash image width, it will be equal display width
    final int windowWidth = metrics.widthPixels;

    final int statusBarHeight = (int) Math.ceil(STATUS_BAR_HEIGHT * getResources().getDisplayMetrics().density);
    //get splash image height (display height - status bar height)
    final int windowHeight = metrics.heightPixels - statusBarHeight;

    final BitmapFactory.Options options = new BitmapFactory.Options();
    options.inJustDecodeBounds = true;
    final int inSampleSize = ImageUtils.calculateInSampleSize(options, windowWidth, windowHeight);
    options.inSampleSize = inSampleSize;
    options.inJustDecodeBounds = false;

    final Bitmap bitmap = BitmapFactory.decodeResource(getResources(), resId, options);
于 2013-09-23T14:15:22.143 回答