Code example for DialogFragment

0
import android.view.ViewGroup; 
import android.widget.TextView; 
 
import com.newsblur.R; 
 
public class AlertDialogFragment extends DialogFragment {
 
	public String message = "";
	 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setStyle(DialogFragment.STYLE_NO_TITLE | DialogFragment.STYLE_NO_FRAME, R.style.dialog);
		setCancelable(true);
	} 
	 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.fragment_dialog, null);
		TextView messageView = (TextView) v.findViewById(R.id.dialog_message);
		messageView.setText(message);