i want to build a customized dialog just like the one shown in image:
i
You just have to inflate the Dialog with your xml file. I'll just give you a sample code, then you can easily follow
private View mView;
private Dialog mDialog;
private LayoutInflater mInflater;
Now create a function as :-
private void showCustomDialog() {
mInflater = (LayoutInflater) getBaseContext().getSystemService(
LAYOUT_INFLATER_SERVICE);
ContextThemeWrapper mTheme = new ContextThemeWrapper(this,
R.style.YOUR_STYE);
mView = mInflater.inflate(R.layout.YOUR_XML_LAYOUT_FILE, null);
// mDialog = new Dialog(this,0); // context, theme
mDialog = new Dialog(mTheme);
mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mDialog.setContentView(this.mView);
mDialog.show();
TextViiew someText = (TextView) mView.findViewById(R.id.textViewID);
// do some thing with the text view or any other view
}
Finally make sure you have the style as :-
That's it .... you are done... just call this function where ever you want to show the custom dialog....
Hope the explanation was useful....