how to show alert inside an activity group?
I h开发者_C百科ave a tab bar inside my app and to maintain it I have used activity group. On clicking these tabs I have to show a set of activities. My problem is I am not able to show an alert dialog or any other dialogs inside these activities. An error occurs saying "unable to add window". Can anyone tell how to solve this issue?
It gives above error because of the Context I was providing to alertdialog builder.
Give:
new AlertDialog.Builder(getParent()).setMessage(“Hello world”).show();
We just need to call getParent() instead of AlertDialog.Builder(this)
精彩评论