Well you what? Create your markup with your white square and everything your heart desires, call it, for example, alert.xml .
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="150dp" android:layout_height="150dp" android:backgroynd="#FAFAFA" android:elevation="5dp" android:gravity="center"> <TextView android:text="Hello, AlertDialog!" android:id="@+id/ad_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout>
Further
AlertDialog.Builder adb = new AlertDialog.Builder(this); View my_custom_view = (LinearLayout) getLayoutInflater().inflate(R.layout.alert, null); //Π½Π°Ρ
ΠΎΠ΄ΠΈΠΌ ΡΠ°Π·ΠΌΠ΅ΡΠΊΡ adb.setView(my_custom_view); //ΡΡΠ°Π²ΠΈΠΌ Π΅Π΅ Π² ΠΎΠΊΠ½ΠΎ TextView ad_tv = (TextView)my_custom_view.findViewById(R.id.ad_tv); //Π½Π°Ρ
ΠΎΠ΄ΠΈΠΌ TextView ad_tv.setTextColor(Color.BLACK); AlertDialog ad = adb.create(); ad.show();
Edit
Dialog d = new Dialog(this); View my_custom_view = getLayoutInflater().inflate(R.layout.alert, null); d.setContentView(my_custom_view); TextView ad_tv = (TextView)my_custom_view.findViewById(R.id.ad_tv); ad_tv.setTextColor(Color.BLACK); d.show();