我发现所有东西都可以与警报框、对话框一起使用,但是当我尝试使用自己的自定义对话框创建东西时,它给我带来了问题。虽然我按照开发指南中的说明进行操作: http:// /developer.android.com/intl/de/guide/topics/ui/dialogs.html 我无法获得结果,只是显示强制关闭并显示以下错误消息。
03-04 11:37:08.780: ERROR/AndroidRuntime(726): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
我已经尝试制作自定义对话框很多天了,但我无法调出它。我什至尝试了在论坛上获得的解决方案,但这似乎也不起作用。
给我一些好的代码或一些可以使用的建议...对此的任何建议都是值得赞赏的。
I found all things working with alert box,dialog box but when i try creating things with my own custom dialog box it gives me problems. Though i followed the instructions as per the dev guide: http://developer.android.com/intl/de/guide/topics/ui/dialogs.html i could'nt reach with my results just it displays a force close with the following error message.
03-04 11:37:08.780: ERROR/AndroidRuntime(726): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
I have been trying to make my custom dialog box for many days but i couldnt bring it up. I even tried with the solutions that i got on forums but that too doesnt seems of working.
Give me some piece of good code or some suggestion to work with... Any suggestions on this is appreciable.
发布评论
评论(2)
Android 对话框 - 困惑看看这个问题,看起来与你的类似。此外,您还必须共享导致错误的代码,否则很难提供帮助。
Android Dialog - confused take a look on the question, looks similar to yours. Also you have to share a code which results in the error otherwise it is hard to help.
创建 custom_dialog xml
在 MainActivity.java 中添加自定义对话框视图
这是您的 main_activity.xml
http://www.techamongus.com/2017/03/android-create-custom-dialog-program.html
create custom_dialog xml
Add custom dialog View in MainActivity.java
here is your main_activity.xml
http://www.techamongus.com/2017/03/android-create-custom-dialog-program.html