i have code like this but why i can't see the progressdialog?
progress = ProgressDialog.show(MainActivity.this, "MOHON DITUNGGU", "Loading...", true);
String urlATM = "http://eplace.hol.es/android/OutputATM.php";
try {
JSONArray data = new JSONArray(getJSONUrl(urlATM));
if(data.length()!=0){
HashMap<String, String> map;
for (int i = 0; i < data.length(); i++) {
JSONObject c = data.getJSONObject(i);
map = new HashMap<String, String>();
map.put("id_atm", c.getString("id_atm"));
map.put("id_bank", c.getString("id_bank"));
map.put("nama_bank", c.getString("nama_bank"));
map.put("latitude", c.getString("latitude"));
map.put("longitude", c.getString("longitude"));
map.put("name", c.getString("name"));
map.put("email", c.getString("email"));
MyArrListATM.add(map);
//end add marker
maps.addMarker(new MarkerOptions()
.title("ATM"+MyArrListATM.get(i).get("nama_bank"))
.snippet("24 Jam")
.position(new LatLng(
Double.parseDouble(MyArrListATM.get(i).get("latitude")),
Double.parseDouble(MyArrListATM.get(i).get("longitude")))));
}
progress.dismiss();
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
progress.dismiss();
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
alertDialog.setTitle("PERINGATAN");
alertDialog.setMessage("Error: "+e.getMessage());
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "TUTUP", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}
and i try to remove some code so the code like this
progress = ProgressDialog.show(MainActivity.this, "MOHON DITUNGGU", "Loading...", true);
and progressdialog is coming show
so how to show progressdialog with my some code like above?