ProgressDialog
内で のメッセージ表示のフォント書体を変更することは可能DialogFragment
ですか?
public class LoadFromCloudTaskFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
this.progressDialog = new ProgressDialog(this.getActivity());
this.progressDialog.setMessage(progressMessage);
this.progressDialog.setCanceledOnTouchOutside(false);
return progressDialog;
}
から継承してカスタム クラスを作成するProgressDialog
ことも方法の 1 つかもしれません。しかし、私は知りたいのですが、より良い代替手段はありますか? 悲しいことに、私たちは持っていませんProgressDialog.Builder
。
私が試した代替手段の1つは
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
this.progressDialog = new ProgressDialog(this.getActivity());
this.progressDialog.setMessage(progressMessage);
this.progressDialog.setCanceledOnTouchOutside(false);
Utils.setCustomFont(this.progressDialog.findViewById(android.R.id.message), Utils.ROBOTO_LIGHT_FONT);
return progressDialog;
}
しかし、これは私にエラーを与えるでしょう
android.util.AndroidRuntimeException: コンテンツを追加する前に requestFeature() を呼び出す必要があります