I am loading the data using http connection,when it does i am using progress dialog box. The problem is when i press the hardware back button , dialog box is removed before loading all the data,but data is showed successfully,
the code for back button is i have used is,
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0)
{
return true;
}
return super.onKeyDown(keyCode, event);
}开发者_Go百科
public void onBackPressed()
{
return;
}
You could use progressBar.setCancelable(false);
From the docs:
setCancelable(boolean flag)
Sets whether this dialog is cancelable with the BACK key.
精彩评论