开发者

How to use vendor theme in Android application

I'm developing my "Hello, World" application for Android and came around something that annoys me.

The theme used for my app's AlertDialog isn't the same used for other such dialogs presented on the device. The device is a HTC Desire HD on which I've changed the theme, but I was expecting that standard UI ele开发者_如何学Cments (like AlertDialog) would somehow reflect the device theme. It's something that I'm missing or maybe a know problem with some vendors/models?

Here's my code:

final AlertDialog.Builder confirm = new AlertDialog.Builder(this);
confirm.setTitle("Delete")
       .setMessage("Really Delete?")
       .setPositiveButton("Delete", new DialogInterface.OnClickListener() {
           @Override
           public void onClick(DialogInterface dialog, int which) {
               // ...
           }
       })
       .setNegativeButton("Cancel", null)
       .show();

And here's how the dialog looks like in different situations:

Device's AlertDialog with default theme (Messages app)

How to use vendor theme in Android application

Device's AlertDialog with changed theme (Messages app)

How to use vendor theme in Android application

My app's AlertDialog (with both default and changed theme)

How to use vendor theme in Android application

Thanks.


Your assumption is correct. HTC have most likley created customized dialogs for the HTC apps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜