If you are going to be doing something that takes a long time you need to use separate threads. If you try to do long processes in your main UI thread then UI events (like open ProgressDialog) will not work.
I wrote a small tutorial which may help: http://www.helloandroid.com/node/243 -- Zach Hobbs HelloAndroid.com Android OS news, tutorials, downloads On Monday 30 June 2008 11:55:31 6real wrote: > Dear all, > > Here is the behavior I expect from my app : > I have a customized YES/NO dialog box. > > if the customer says YES, then I'd like to show a progress dialog > (even a custom one, juste to incidate that a long process is running). > > I really have issues with the progress dialog (does not appear and ) > so I decided to use a custom view. > > 1 - try : The progressdialog class. > An error here, a. the window does not pop-up and when I try to > dismiss, I have an error message (telling the dialog is not linked to > a window or something like that) > > 2 - try :show a custom pop-up with a progressbar inside > The alert dialog never pops-up. > > 3 - try : change the (content)view of the yes/no dialog > The yes/no dialog change at the end of the onclick method. > > Here is the snippet, because this si my last try : > --------------------------- > View viewUpdateValidation = (View) > vi.inflate(R.layout.dialog_validate_station_update, null, null); > > final AlertDialog dialogValidateUpdate = new > AlertDialog.Builder(Veloid.this).setTitle(R.string.menu_about) > > .setView(viewUpdateValidation) .show(); > > ImageButton btnOKupdate = (ImageButton) > dialogValidateUpdate.findViewById(R.id.input_update_station_lst_btn_valid); > btnOKupdate.setOnClickListener(new OnClickListener() { > public void onClick(View clicked) { > > dialogValidateUpdate.setView((View) > vi.inflate(R.layout.dialog_progress_update_stations, null, null)); > > > //update > mgr.updateStationListDynamicaly(); > > //dialogValidateUpdate.dismiss(); > > } > // AFTER THE CALL THE setViewMethod DOES A CHANGE. > }); > --------------------------- > > Can you please give me ideas on how to do what I would like : show a > pop-up with a progress bar when YES is clicked (I don't mind to > dismiss the main YES/NO dialog.) > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

