mcfly soft
mcfly soft

Reputation: 11655

Clicking beside dialog hides the dialog

At start of my Android app I show a dialog in the middle of the screen ( fills 30% of the screen) indicating that the app is loading ( takes 1 minute ). When I click outside of the dialog ( 70%) the dialog disappears and I have a black screen.

How can I prevent this ?

At start I set :

tbl = (LinearLayout) findViewById(R.id.main);

and then during loading I do :

HprogressDialog = new HistoryProgressDialog(this);
HprogressDialog.show();

new Thread() {

        public void run() {
...
...

any hints ?

( This problem I did not have in the past. So I guess it could be of upgrading to a higher API-Level ? )

Upvotes: 0

Views: 53

Answers (2)

Piyush
Piyush

Reputation: 18923

you should use this..

 dialog.setCanceledOnTouchOutside(false);

Upvotes: 2

kalyan pvs
kalyan pvs

Reputation: 14590

Add this line before show dialog..

dialog.setCanceledOnTouchOutside(false);

Upvotes: 2

Related Questions