私はカスタムを作成しましたProgress Dialogue
。 setCancelable()
、setCanceledOnTouchOutside()
のようなプロパティを無効にすることはできません。Androidカスタムプログレスダイアログ - setCancelable()
public class CustomProgressDialogue extends ProgressDialog {
private final Context context;
public CustomProgressDialogue(Context context) {
super(context);
this.context = context;
getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.progress_view);
}
// Didn't worked
@Override
public void setCancelable(boolean flag) {
super.setCancelable(false);
}
// Didn't worked
@Override
public void setCanceledOnTouchOutside(boolean cancel) {
super.setCanceledOnTouchOutside(false);
}
}
インスタンス作成後に同じプロパティを適用すると同時に同じ時間が適用されます。
// Worked
progressDialogue = new CustomProgressDialogue(getContext());
progressDialogue.setCancelable(false);
progressDialogue.setCanceledOnTouchOutside(false);
誰かがこれを説明できますか?
なぜ 'MetricsProgressDialogue'を設定しますか? 'CustomProgressDialogue'の代わりに? –
申し訳ありませんがコピー貼り間違いでした。今修正しました –