android - Two AlertDialog, onCancel, and "Attempt to finish an input event, but the input event receiver has already been disposed. " -
i have code showing dialog account picker. dialog reached clicking button 'authenticate' in alertdialog dologindialog
.
accountpicker = new alertdialog.builder(this) .settitle(getstring(r.string.common_select_an_account)) .setadapter(new arrayadapter<string>(this, android.r.layout.simple_list_item_1, name), new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { if (which < availableaccounts.length) { final account chosenaccount = availableaccounts[which]; authenticator.verifyaccount(chosenaccount, mainactivity.this); } else { authenticator.addnewaccount(mainactivity.this); } }}).create(); accountpicker.setcancelable(true); accountpicker.setcanceledontouchoutside(true); accountpicker.setoncancellistener(new dialoginterface.oncancellistener() { @override public void oncancel(dialoginterface dialog) { if(debug) log.d(tag, "oncancel - accountpickerdialog"); showdologindialog(); }}); accountpicker.show();
basically, if user cancel alertdialog accountpicker
show again alertdialog dologindialog
.
when cancel alertdialog accountpicker
see these messages in (unfiltered) log:
attempted finish input event input event receiver has been disposed.
it not cause problem application, understand happening. have searched, find more complex situations. basic hope find me understand happening here.
i had same issue , found explanation here
it seems normal behaviour due event handling workflow. avoid warning, need set dialog not cancelable (even when touching outside), , add cancel button within dialog dismiss it.
hope helps!
Comments
Post a Comment