Code example for DialogFragment

Methods: setCancelable

0
 
public class ProgressDialog extends DialogFragment {
 
    public static ProgressDialog newInstance() { 
        ProgressDialog f = new ProgressDialog();
        f.setCancelable(false);
        return f;
    } 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        setStyle(STYLE_NO_TITLE, 0);
    } 
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.progress_dialog, container, false);
        return v;
    }