我是在这里提问的新手,所以任何关于此的建议都将不胜感激......但我的问题是:enter code here
我试图在等待来自服务器的数据时显示进程对话..我正在使用改造调用从服务器获取数据并在我们的项目中使用 MVP 模式..但是在调用转到服务器时显示黑屏..并在之后直接加载内容得到回应我从几天开始就被困在这一点上。
public class ReceiptRegisterActivity extends AppCompatActivity implements ReceiptRegisterPresenter.ReceiptRegisterPresenterListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_receipt_register);
progressBar = new ProgressDialog(ReceiptRegisterActivity.this);
progressBar.setCancelable(true);
progressBar.setMessage("Fetching Data...");
progressBar.setProgress(20);
progressBar.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressBar.show();
progressBarStatus = 0;
spinner = (SearchableSpinner)findViewById(R.id.spinner);
editsearch = (android.widget.SearchView) findViewById(R.id.search);
editsearch.setOnQueryTextListener(this);
expandButton =(Button)findViewById(R.id.expandButton);
byDate =(Button)findViewById(R.id.byDate);
byCustomer=(Button)findViewById(R.id.byCustomer);
byDate.setFocusable(false);
allEventLIstener();
dbHelperObj=new DBHelper(this);
try{
dbHelperObj.createDB();
}catch (Exception e){
throw new Error(e);
}
try{
dbHelperObj.openDataBase();
}catch (SQLiteException e){
e.printStackTrace();
}
//srActivity = this;
// progressBar = new ProgressBar(this);
// progressBar.setVisibility(View.VISIBLE);
receptRegisterPresenterObj = new ReceiptRegisterPresenter(this,this);
receptRegisterPresenterObj.getReceiptRegisterData();
}
public void receiptRegisterDataReady(Object obj) {
/// Getting Response In This Block Doing Some Manupilation And Dismiss progressBar...
progressBar.dismiss();
}`
谢谢你的帮助