Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dialog pauses calling activity?

Tags:

android

dialog

With the risk of this beeing a stupid question:

Every time I create a dialog the activity that creates and owns the dialog gets paused-I say this because the animations from my activity stop running. Is there a way to create the dialog so that your animations will keep running although the focus will be set to the dialog? Thanks.

like image 479
Fofole Avatar asked Feb 21 '12 11:02

Fofole


1 Answers

Activity's lifecycle is such as that if activity loses focus, its onPause method gets called, if you dont want such, and still want to lose focus from the activity layout, have a relative layout both having width and height fill parent, in one have your activity layout, and of other layout's background transparent, add ProgressBar to second layout. set second layout's visibility gone initially. and set visible or gone when you want to display or dismiss dialog.

like image 160
jeet Avatar answered Oct 01 '22 16:10

jeet