Android examples for User Interface:View
show Alert Window With Custom View
import java.util.Calendar; import java.util.List; import android.content.Context; import android.content.DialogInterface; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.View.MeasureSpec; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import android.widget.Button; import android.widget.DatePicker; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.TimePicker; import android.widget.Toast; public class Main{ /** mAlertWindow */ private static AlertWindow mAlertWindow; public static AlertWindow showAlertWindowWithCustomView( Context context, View customView, boolean closable, boolean showSoftInput) { int style = AlertWindow.HAS_CUSTOM; AlertWindow aw = new AlertWindow(context, style, customView); mAlertWindow = aw;//from w w w . j a v a 2 s . c om aw.setClosable(closable); if (showSoftInput) { aw.getWindow().setSoftInputMode( LayoutParams.SOFT_INPUT_STATE_VISIBLE); } aw.show(); return aw; } }