开发者

Android Fragmentation AlertDialog Problem?

When I run a code for the alertDialog on an Emulator with Android 2.2 it works like its supposed to and everything however, when I attempt to do the same on my Samsung Captivate which also runs on Android 2.2 it gives a transparent black cover over the application layout just like in the emulator except it fails to show the actual Dialog none of the edittext and other elements are focusable just like in a regular dialog environment however, again, the actual Dialog is missing. I don't understand what to do as both run on the same Operating System. Below is the code (it is located in the onCreate() method of my Activity):

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Please rate me on the Android Market!")
   .setCancelable(true)
   .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
       public void onClick(DialogInterface dialog, int id) {

       }
   })
 开发者_JS百科  .setNegativeButton("No", new DialogInterface.OnClickListener() {
       public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
       }
   });
AlertDialog alert = builder.create();
alert.show();


Maybe you should try debugging the application on your device, and connect it through the USB cable if you are not already doing so. This has never happened to me, and I do not see it as a bug or a common occurrence. If you are not showing the complete code for the dialog, it could have something to do with internet(or other permissions running before and after this code). I would suggest you check:

1) Permissions

2)Storage Problems

3) Confirm the compatibility of the application and your device once more.

Hope this helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜