When using sdk for facebook android to open dialogs, everything works fine.
However, if the user clicks the back button, the dialog does close, but the onCancel method of the dialog listener (or any other method) is not called.
I searched about this question and found this pull request from fb android sdk on github: Call Cancel on DialogListener when the dialog is canceled .
I took one part and slightly modified it to get the following:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
mWebView.stopLoading();
dismiss();
mListener.onCancel();
return true;
}
return true;
}
and I added it to the FbDialog class, and it really seems to be a trick.
What I wonder is why this is not part of sdk? This stretch request is more than a year old, and the last answer is about 11 months. Why not add it to the sdk source?
, , facebook sdk, (/ ).
?