Possible Duplicate:
How to display progress dialog before starting an activity in Android?
this is my itemDetails extends Activity
class and onOkClick
is the method. But when I press the ok button i.e call the method no ProgressDialog
shows up. But the Toast messages show correctly.
I tried using getApplicationContext()
in the Context parameter of the ProgressDialog.show()
method, but it is not working. Sorry for this naive question.
public void onOkClick(View v){
ProgressDialog pleaseWait = ProgressDialog.show(itemDetails.this, "Uploading..", "Please wait for a while...", true);
//...........
HttpData httpData = HttpRequest.post("http://www.abc.com/accessServer.php", "");
//...........
pleaseWaitGallery.dismiss();
if(HttpPostTesting.storestring.contains("successful")){
Toast.makeText(getApplicationContext(), "Uploading Complete", Toast.LENGTH_LONG).show();
}
else {
Toast.makeText(getApplicationContext(), "Uploading Failed!", Toast.LENGTH_LONG).show();
}
}