I am New to Android, and have doing coding to satisfy my various needs.
I have a strange problem, in which i need to show Progress Dialog to cover up my background work of downloading images from Facebook and show them in a ListView after i get them in a Vector Object.
My Code Goes Like this :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
facebook.authorize(this, new String[] { "email", "publish_checkins",
"user_photos" },
//new Dialog Listner code
btnAlb = (Button) findViewById(R.id.btnAlb);
logout = (Button) findViewById(R.id.logout);
btnAlb.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//** Log.i("pDialog","Entry");
pdialog = ProgressDialog.show(MainActivity.this, "Processing Data","Loading..");
//this is not working !!
//** Log.i("pDialog","Exit");
try {
//Lot of JSON Parsing
pdialog.dismiss();
Intent intent = new Intent(MainActivity.this,AlbumHolder.class);
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
pdialog.dismiss();
}
}
});
}
So i have Logged the Start and End of ProgressDialog and expected the dialog to show up. but it didn't. can somebody explain why?
I have also used a runOnUiThread() Thread, but it also yielded the same result.