fix showNotAgainDlgThen(): when the pref is set to skip the hint, we

still can't call the callback directly because then
showNotAgainDlgThen() is synchronous only in that case.  For
consistency, post the callback call to a handler.
This commit is contained in:
Eric House 2013-10-24 19:18:42 -07:00
parent 266cd6fe85
commit 33252c929c

View file

@ -157,15 +157,21 @@ public class DlgDelegate {
}
public void showNotAgainDlgThen( int msgID, int prefsKey,
int callbackID, Object[] params )
final int callbackID,
final Object[] params )
{
if ( XWPrefs.getPrefsBoolean( m_activity, prefsKey, false ) ) {
// If it's set, do the action without bothering with the
// dialog
if ( SKIP_CALLBACK != callbackID ) {
m_clickCallback.dlgButtonClicked( callbackID,
AlertDialog.BUTTON_POSITIVE,
params );
post( new Runnable() {
public void run() {
m_clickCallback
.dlgButtonClicked( callbackID,
AlertDialog.BUTTON_POSITIVE,
params );
}
});
}
} else {
String msg = m_activity.getString( msgID );
@ -221,7 +227,8 @@ public class DlgDelegate {
} else {
post( new Runnable() {
public void run() {
m_clickCallback.dlgButtonClicked( callbackID, EMAIL_BTN, null );
m_clickCallback.dlgButtonClicked( callbackID, EMAIL_BTN,
null );
}
});
}