Android – how do I display alerts within an active group?

My application has a tab bar. In order to maintain it, I use an activity group. When I click these tabs, I must display a group of activities. My problem is that I can't display warning dialog boxes or any other dialog boxes in these activities. If an error occurs, say "cannot add window". Anyone can tell me how to solve this problem?

resolvent:

Due to the context I provided to the alertdialog builder, it gives the above error

To:

new AlertDialog.Builder(getParent()).setMessage(“Hello world”).show();

We just need to call GetParent () instead of alertdialog. Builder (this)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>