I would like to know how to customize theme/style of AlertDialog using sdk api 10. I know how to do that from 11 onwards but not how to do it on the 10.
XML Layout file
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" style="@style/dialog_theme" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/disclaimerText" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/disclaimer" android:padding="5dp"/> <CheckBox android:id="@+id/checkDisclaimer" style="?android:attr/textAppearanceMedium" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" android:text="@string/agree" /> </LinearLayout> </ScrollView> JAVA Resource file
AlertDialog.Builder builder = new AlertDialog.Builder(this); //Setting Dialog Title builder.setTitle("Disclaimer"); //Setting Dialog Message builder.setMessage(R.string.disclaimer); View view = (View) LayoutInflater.from(this).inflate(R.layout.layout_disclaimer, null); builder.setView(view);