I have overriden the onSavedInstanceState and removed the super, i am not doing any transactions, let alone transactions in volatile functions or async ones.
I am calling it in a custom callback 'onUserExistsListener'
@Override
public Boolean userExists(Boolean exists) {
if (exists) {
}
else
{
AlertDialogFragment Frag = AlertDialogFragment.newInstance(0, null);
Frag.show(getSupportFragmentManager(), "warndialog");
}
};
Have tried everything suggested in the other SO questions and still found no solution? Anyone?
code:
AlertDialogFragment Frag = AlertDialogFragment.newInstance(0, null);
Frag.show(getSupportFragmentManager(), "warndialog");
The process:
OnCreate: (LoadNames function)
LoadNames Callback -> Show dialog.
Further:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
add_name_to_db();
}
function:
public void add_name_to_db() {
Details.checkNameExists(user_txt.getText().toString());
Details.setOnUserExistsListener(new onUserExistsListener() {
@Override
public Boolean userExists(Boolean exists) {
if (exists)
{
} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
AlertDialogFragment Frag = AlertDialogFragment.newInstance(0, null);
Frag.show(getSupportFragmentManager(), "warndialog");
}
});
}
} else {
Toast.makeText(getApplicationContext(), "This is not a valid KIK username",
Toast.LENGTH_SHORT).show();
}
return exists;
}
});
}