java - Android Loading Error: Performing Stop of Activity that is Not Resumed -
i creating loading screen application, checking firebase see if user logged in. depending on authentication state of user, load specific activity within application.
i receiving appears redundant error freezing application , not accessing next activity:
04-18 21:13:52.400 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -2147483646 04-18 21:13:52.475 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:13:52.475 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:13:52.840 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:53.147 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:53.240 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:13:53.240 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:13:53.653 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:53.972 32330-32330/com.sourcey.materialloginexample e/activitythread: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} java.lang.runtimeexception: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} @ android.app.activitythread.performstopactivityinner(activitythread.java:3496) @ android.app.activitythread.handlestopactivity(activitythread.java:3593) @ android.app.activitythread.access$1200(activitythread.java:157) @ android.app.activitythread$h.handlemessage(activitythread.java:1385) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5527) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:730) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:620) 04-18 21:13:54.086 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:54.173 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:13:54.173 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:13:54.783 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:55.063 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:55.144 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:13:55.144 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:13:55.538 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:55.820 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:55.913 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:13:55.914 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:13:56.341 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:56.710 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:56.790 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:13:56.790 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:13:57.260 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:57.527 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:57.612 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:13:57.612 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:13:58.099 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:58.456 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:13:58.637 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:13:58.637 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:13:59.263 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:00.224 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:00.308 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:00.308 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:00.644 32330-32330/com.sourcey.materialloginexample e/activitythread: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} java.lang.runtimeexception: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} @ android.app.activitythread.performstopactivityinner(activitythread.java:3496) @ android.app.activitythread.handlestopactivity(activitythread.java:3593) @ android.app.activitythread.access$1200(activitythread.java:157) @ android.app.activitythread$h.handlemessage(activitythread.java:1385) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5527) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:730) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:620) 04-18 21:14:00.694 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:00.895 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:00.895 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:01.378 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -2147483646 04-18 21:14:01.735 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:01.825 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:01.825 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:02.940 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:03.687 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:03.793 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:03.793 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:03.984 32330-32330/com.sourcey.materialloginexample e/activitythread: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} java.lang.runtimeexception: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} @ android.app.activitythread.performstopactivityinner(activitythread.java:3496) @ android.app.activitythread.handlestopactivity(activitythread.java:3593) @ android.app.activitythread.access$1200(activitythread.java:157) @ android.app.activitythread$h.handlemessage(activitythread.java:1385) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5527) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:730) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:620) 04-18 21:14:04.166 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:04.307 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:04.307 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:04.677 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:05.072 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:05.165 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:05.165 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:05.561 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -2147483646 04-18 21:14:05.844 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:05.958 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:05.958 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:07.326 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:07.644 32330-32330/com.sourcey.materialloginexample e/activitythread: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} java.lang.runtimeexception: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} @ android.app.activitythread.performstopactivityinner(activitythread.java:3496) @ android.app.activitythread.handlestopactivity(activitythread.java:3593) @ android.app.activitythread.access$1200(activitythread.java:157) @ android.app.activitythread$h.handlemessage(activitythread.java:1385) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5527) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:730) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:620) 04-18 21:14:07.654 32330-32512/com.sourcey.materialloginexample e/surface: queuebuffer: error queuing buffer surfacetexture, -22 04-18 21:14:07.839 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:07.839 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:09.065 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 0, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:09.065 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:12.391 32330-32330/com.sourcey.materialloginexample e/activitythread: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} java.lang.runtimeexception: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} @ android.app.activitythread.performstopactivityinner(activitythread.java:3496) @ android.app.activitythread.handlestopactivity(activitythread.java:3593) @ android.app.activitythread.access$1200(activitythread.java:157) @ android.app.activitythread$h.handlemessage(activitythread.java:1385) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5527) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:730) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:620) 04-18 21:14:12.502 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 1, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:12.502 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:13.738 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 1, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:13.738 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:16.893 32330-32330/com.sourcey.materialloginexample e/activitythread: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} java.lang.runtimeexception: performing stop of activity not resumed: {com.sourcey.materialloginexample/com.troychuinard.fanpolls.preferencesactivity} @ android.app.activitythread.performstopactivityinner(activitythread.java:3496) @ android.app.activitythread.handlestopactivity(activitythread.java:3593) @ android.app.activitythread.access$1200(activitythread.java:157) @ android.app.activitythread$h.handlemessage(activitythread.java:1385) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5527) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:730) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:620) 04-18 21:14:17.250 32330-32512/com.sourcey.materialloginexample e/parcel: dup() failed in parcel::read, 1, fds[i] -1, fd_count 2, error: bad file descriptor 04-18 21:14:17.251 32330-32512/com.sourcey.materialloginexample e/surface: dequeuebuffer: igraphicbufferproducer::requestbuffer failed: -22 04-18 21:14:38.321 5484-5644/com.sourcey.materialloginexample e/surface: getslotfrombufferlocked: unknown buffer: 0xb8cc2500
here simple loading activity, unsure producing error:
public class loadingactivity extends appcompatactivity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_loading); firebase.setandroidcontext(this); final firebase userref = firebaseutil.firebase.child("users"); final authdata authdata = userref.getauth(); if (authdata != null) { userref.addlistenerforsinglevalueevent(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { string selectedprefs = (string) datasnapshot.child(authdata.getuid()).child("selected_prefs").getvalue(); if (textutils.isempty(selectedprefs) || !selectedprefs.equals("true")) { startactivity(new intent(loadingactivity.this, preferencesactivity.class)); } else { startactivity(new intent(loadingactivity.this, mainactivity.class)); } finish(); } @override public void oncancelled(firebaseerror firebaseerror) { startactivity(new intent(loadingactivity.this, signupactivity.class)); finish(); } }); } else { startactivity(new intent(loadingactivity.this, signupactivity.class)); finish(); } } }
here preferencesactivity:
public class preferencesactivity extends appcompatactivity { private toolbar toolbar; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); firebase.setandroidcontext(this); setcontentview(r.layout.activity_preferences); toolbar = (toolbar) findviewbyid(r.id.tool_bar); setsupportactionbar(toolbar); createnavdrawer(); } private void createnavdrawer() { final primarydraweritem item1 = new primarydraweritem().withname(r.string.drawer_item_home).withidentifier(1); secondarydraweritem item2 = new secondarydraweritem().withname(r.string.drawer_item_previous_polls).withidentifier(2); secondarydraweritem item3 = new secondarydraweritem().withname(r.string.drawer_item_preferences).withidentifier(3); secondarydraweritem item4 = new secondarydraweritem().withname(r.string.drawer_item_request_poll).withidentifier(4); secondarydraweritem item5 = new secondarydraweritem().withname(r.string.drawer_item_suppport).withidentifier(5); secondarydraweritem item6 = new secondarydraweritem().withname(r.string.drawer_item_logut).withidentifier(6); accountheader headerresult = new accountheaderbuilder() .withactivity(this) .withheaderbackground(r.drawable.ic_facebook) .addprofiles( new profiledraweritem().withemail("bob@gmail.com").withicon(getresources().getdrawable(r.drawable.logo)) ) .withonaccountheaderlistener(new accountheader.onaccountheaderlistener() { @override public boolean onprofilechanged(view view, iprofile profile, boolean currentprofile) { return false; } }) .build(); drawer result = new drawerbuilder() .withaccountheader(headerresult) .withactivity(this) .withtoolbar(toolbar) .adddraweritems( item1, new dividerdraweritem(), item2, item3, item4, item5, item6 ) .withondraweritemclicklistener(new drawer.ondraweritemclicklistener() { @override public boolean onitemclick(view view, int position, idraweritem draweritem) { draweritem.withsetselected(true); switch ((int)draweritem.getidentifier()) { case 1: intent tohomeactivity = new intent(getapplicationcontext(), mainactivity.class); startactivity(tohomeactivity); break; case 2: break; case 3: intent topreferencesactivity = new intent(getapplicationcontext(), preferencesactivity.class); startactivity(topreferencesactivity); break; } return false; } }) .build(); result.setselection(3); } }
i using third-party library initialize navigation drawer: https://github.com/mikepenz/materialdrawer
i have since removed library , working perfectly. looks google's recent updates have deprecated library (either intentionally or unintentionally). best approach, going forward, use native code.
the createnavdrawer() method initialized library.
Comments
Post a Comment