를 액세스해야한다는 것입니다. 정적 show(...)
방법은 동일한 단계를 수행하는 당신이 :
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message) {
return show(context, title, message, false);
}
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate) {
return show(context, title, message, indeterminate, false, null);
}
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate, boolean cancelable) {
return show(context, title, message, indeterminate, cancelable, null);
}
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate,
boolean cancelable, OnCancelListener cancelListener) {
ProgressDialog dialog = new ProgressDialog(context);
dialog.setTitle(title);
dialog.setMessage(message);
dialog.setIndeterminate(indeterminate);
dialog.setCancelable(cancelable);
dialog.setOnCancelListener(cancelListener);
dialog.show();
return dialog;
}
당신은 볼 수 매개 변수 그냥해서 ProgressDialog를 건설 끝과 인스턴스 메소드 show()
를 호출 정적 show
방법에 대한 호출.
정적 인 show(...)
메서드를 사용하면 한 줄의 코드를 사용하여 기본 ProgressDialog를 편리하게 표시 할 수 있습니다.
사실, show() 메소드는 정적이 아닙니다. 그것은 'Dialog'의 인스턴스 메소드입니다. – kurtacious
의사가 정체라고 말했습니다. –
오. @ ΦXocę 웃어 Пepeúpa ツ : 커다란이 맞습니다. ['Dialog'] (https://developer.android.com/reference/android/app/Dialog.html) (['ProgressDialog'의 수퍼 타입) (https://developer.android.com/reference/ android/app/ProgressDialog.html)) static이 아닌 ['show'] (https://developer.android.com/reference/android/app/Dialog.html#show()) 메소드도 존재합니다. 인자를 취하지 않는다). OP는이 두 가지 방법의 차이점을 묻습니다. – Seelenvirtuose