Android AlertDialog produces black text with black background -
Android AlertDialog produces black text with black background -
i having issue custom view in dialog on android api 10.
i utilize alertdialog.builder
build dialog. include custom view panel using setview
command on builder.
this works on of api's i've tested with. style changes device device, want, style match device default.
my problem on api 10, text in custom view shows black on black background.
any text insert using alertdialog.builder.setmessage()
appears correctly.
what magical attribute/style dialog builder using determine text appearance?
my app's theme theme.appcompat.light
.
here oncreatedialog method:
public dialog oncreatedialog(bundle savedinstancestate) { layoutinflater inflater = getactivity().getlayoutinflater(); final view view = inflater.inflate(r.layout.fragment_status_dialog, null); mstatustextview = (textview) view.findviewbyid(r.id.text_status); mconnecteddevicetextview = (textview) view.findviewbyid(r.id.text_connected_device); mainservice.servicestate state = null; if (getarguments().containskey(service_status_arg_key)) { state = (mainservice.servicestate) getarguments().getserializable(service_status_arg_key); } setstate(state); alertdialog.builder builder = new alertdialog.builder(getactivity()); builder.setview(view); builder.setmessage("this show fine."); builder.settitle(getstring(r.string.status_title)); builder.setnegativebutton(r.string.dialog_back_button_text, null); builder.setneutralbutton(r.string.dialog_connect_to_text, new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { mlistener.ondialogconnectto(); } }); // create alertdialog object , homecoming homecoming builder.create(); }
here's fragment_status_dialog layout
<?xml version="1.0" encoding="utf-8"?> <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android" android:padding="18dp"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:text="@string/status_starting" android:id="@+id/text_status"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:text="@string/status_connected_to_unknown" android:paddingstart="4dp" android:paddingleft="4dp" android:paddingright="4dp" android:id="@+id/text_connected_device" android:layout_torightof="@+id/text_status" android:layout_toendof="@+id/text_status"/> </relativelayout>
note, i've tried http://stackoverflow.com/a/24505312/2350083 didn't prepare it.
try calling alertdialog#setinversebackgroundforced(true)
.
android
Comments
Post a Comment