我正在使用以下代码更改应用程序主题:
MainActivity.java:
setTheme(R.style.AppBlackTheme);
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
样式.xml:
<style name="AppTheme" parent="android:Theme.Light" />
<style name="AppBlackTheme" parent="android:Theme.Black" />
然后创建 AlertDialog:
SimpleAdapter simpleAdapter=new SimpleAdapter(this, listItems, R.layout.templates_list_item, new String[] {"name","descr"}, new int[] {R.id.name,R.id.descr});
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setSingleChoiceItems(simpleAdapter, -1, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//...
}
});
alert.show();
但在 Android 2.1 中,此 AlertDialog 以白色背景和白色文本显示。如何解决?