• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Query regarding AlertDialog

 
Ranch Hand
Posts: 79
Android Java ME Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello,

I have to make a dialog with 2 editfields and a process which will be handled in AsyncTask on a button click. I found that I can add editfields in alertdialog and work out. My queries are :
1) In the AsyncTask process, I will also have to show a ProgressDialog. Can I show a ProgressDialog on top of AlertDialog ?
2) To make coding simple and easy, I wuold prefer if I can extend AlertDialog. Is it possible to extend AlertDialog or should I extend AlertDialog.Builder ? I am confused with this state.
3) In whichever button presses, eventually the dialog will be closed, but need to run AsyncTask on positive button. Is it fine to work like this with an AlertDialog !
4) Will AlertDialog also handle the orientation part on its own like Landscape or portrait as it is suppossed to do.

Any help, guidance with this can be helpful.

Thanks
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Orientation do affect Alert Dialog.
You can handle AsyncTask too. Just call some method on positive button of AlertDialog.And you can display progressDialog from that method.runOnUiThread I think help you out.
You can make your own customize Alert Dialog too.
 
Trupti Mehta
Ranch Hand
Posts: 79
Android Java ME Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hardik Trivedi wrote:Orientation do affect Alert Dialog.
You can handle AsyncTask too. Just call some method on positive button of AlertDialog.And you can display progressDialog from that method.runOnUiThread I think help you out.
You can make your own customize Alert Dialog too.



Thanks Hardik.

What do you mean by - "Orientation do affect Alert Dialog."
Do you mean that it handles itself and we don't need to code or handle ? Whereas in custom dialog we need to handle it ourselves !!

Well, On positive button clickI will call AsyncTask object. In that only in onPre I will open ProgressDialog and in onPost close the ProgressDialog. I guess this will be running on UI thread only via AsyncTask !!!

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post your code snippet?
 
I was born with webbed fish toes. This tiny ad is my only friend:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic