开发者

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜