Implementing an app where the user can log in I have the following situation: If the user is logged in perform the action else start the login activity for result and if the
Here is the workaround that works fine for me.
private void alert(final String message) {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
public void run() {
AlertDialogFragment alertDialogFragment = AlertDialogFragment.newInstance(message);
alertDialogFragment.show(getFragmentManager(), ALERT_DIALOG_FRAGMENT);
}
});
}