How to show a ProgressDialog while changing from a activity to another activity?
- by AndroidUser99
i want to show a PD when my activity A starts another activity B. But in that onclick method, my A activity haves to do some work before start B, and B also haves to do some work because it haves to load a lot of data for the UI.
I need a PD that is viewed by the user in all the process of the loading data of changin from activity A to B.
¿how can do it?
i tryed storing a static ProgressDialog on MyApplication.java, and with these methods:
public static void showProgressDialog(Context c) {
pd = ProgressDialog.show(c, c.getResources().getString(R.string.app_name),
c.getResources().getString(R.string.loading), true, false);
}
public static void dismissProgressDialog(){
pd.dismiss();
}
but it doesn't works, it doesn't shows nothing, i dont know why
how to achieve this by a easy way? i know that i can do it with async task, but that is too hard for me, i can't understand the code examples i am finding on this web and google
code examples are welcome
thanks