无法锁定表面

时间:2014-08-12 00:04:32

标签: java android android-actionbar

我在我的应用中添加了ActionBar,现在我一直在遇到这个问题。

我正在Galaxy S4进行测试。此问题导致应用程序变慢并变得无法响应。

这是我的代码:

//Get action bar
actionBar = getActionBar();

//hide title to make room for spinner dropdown
actionBar.setDisplayShowTitleEnabled(false);

//set the mode
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
//spinner = (Spinner)findViewById(R.id.spinner);
quotetext = (TextView)findViewById(R.id.quote);       

ArrayList<SpinnerItem> values = SpinnerProducer.create();
//Set spinner adapter   
spinnerAdapter = new QuoteSpinnerAdapter(thisActivity,R.layout.spinner_row_layout,values);

actionBar.setListNavigationCallbacks(spinnerAdapter, new CustomOnItemSelectedListener());
actionBar.setSelectedNavigationItem(1);

堆栈跟踪:

08-11 18:59:51.776: E/Surface(17050): dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: -2147483646
08-11 18:59:51.776: E/Surface(17050): dequeueBuffer failed (Unknown error 2147483646)
08-11 18:59:51.776: E/ViewRootImpl(17050): Could not lock surface
08-11 18:59:51.776: E/ViewRootImpl(17050): java.lang.IllegalArgumentException
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.Surface.nativeLockCanvas(Native Method)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.Surface.lockCanvas(Surface.java:253)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2760)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.ViewRootImpl.draw(ViewRootImpl.java:2734)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2572)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2144)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1235)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6472)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.Choreographer.doCallbacks(Choreographer.java:603)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.Choreographer.doFrame(Choreographer.java:573)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.os.Handler.handleCallback(Handler.java:733)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.os.Handler.dispatchMessage(Handler.java:95)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.os.Looper.loop(Looper.java:157)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at android.app.ActivityThread.main(ActivityThread.java:5356)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at java.lang.reflect.Method.invokeNative(Native Method)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at java.lang.reflect.Method.invoke(Method.java:515)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
08-11 18:59:51.776: E/ViewRootImpl(17050):  at dalvik.system.NativeStart.main(Native Method)

0 个答案:

没有答案