loading popup

All your problems with Audio, Video and Images.

loading popup

Postby Bigbacon » Mon Jan 18, 2010 7:40 pm

What is the best way to go about making a loading popup to display while something else is going on?

My app goes out to a web service of mine to get a url for a image and then that image is placed into an ImageView on the screen.

I want to be able to show a spinning loading type gif (or similar) when I click the next/previsous buttons I have so it shows while the all the back end requests are being done and then it will go away when the image is loaded.
Bigbacon
Junior Developer
Junior Developer
 
Posts: 13
Joined: Mon Jan 18, 2010 1:43 pm

Top

Postby qlimax » Mon Jan 18, 2010 8:12 pm

An easy approach can be this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. ProgressDialog pd; //declare as a class field
  2.  
  3.  
  4.  
  5.  
  6.  
  7. //start the loading dialog
  8.  
  9. pd = ProgressDialog.show(getApplicationContext(), "Title", "Message", true, false);
  10.  
  11.  
  12.  
  13. //loading operations...
  14.  
  15.  
  16.  
  17. //end of loading operations
  18.  
  19. pd.dismiss();
Parsed in 0.031 seconds, using GeSHi 1.0.8.4



bye
¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Postby Bigbacon » Mon Jan 18, 2010 8:23 pm

what if you want to include an image and not just text?
Bigbacon
Junior Developer
Junior Developer
 
Posts: 13
Joined: Mon Jan 18, 2010 1:43 pm

Postby qlimax » Mon Jan 18, 2010 10:52 pm

then I suggest you to create your own Dialog in witch you will set your own content view

you have to create your dialog layout with an xml file

in this xml you have to insert a progressbar (the circle) , an image, what you want

the procedure is explained here
http://developer.android.com/guide/topi ... stomDialog

set the indeterminate mode
http://developer.android.com/reference/ ... ssBar.html

then call show() on the dialog

when you are done call dialog.dismiss();


hope it is clear :roll: sorry I m still learning English...
bye
¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 18 guests