当我尝试使用自定义进度条时,它没有显示进度条,并且一段时间后应用程序崩溃了。
代码:
public class RegistrationScreen extends AppCompatActivity implements View.OnClickListener {
CustomProgressDialog customdialog;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.registration);
}@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.register_submit_btn:
showProgress();
}
private void showProgress() {
customdialog = new CustomProgressDialog(RegistrationScreen.this);
customdialog.setTitle("Please Wait a Movement...");
customdialog.setCanceledOnTouchOutside(false);
customdialog.setCancelable(false);
customdialog.show();
}
}
}