I have a custom DialogPreference function:
public class MyDiagPreference extends DialogPreference { public MyDiagPreference(Context context, AttributeSet attrs) { super(context, attrs); this.setDialogLayoutResource(R.layout.my_diag_preference); } }
This is my_diag_preference.xml:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="8dp" android:orientation="vertical" > <TextView android:id="@+id/testTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Test TextView" /> </LinearLayout>
The problem is that the text color of the TextView is incorrect in Android API 10. The color of the text is always black.
screenshot: http://imgur.com/HDFOIJY
In any case, when I use AlertDialog (non-standard) in my application, the text color changes correctly between the various Android APIs.
So, is there a way to get the color of the text used by the dialog box through xml so that I can use this value to set the colorText of my EditText above?
thanks for the help
source share