How can I make a ProgressDialog be cancelable by the back button but not by a screen tap?

后端 未结 2 827
孤独总比滥情好
孤独总比滥情好 2021-02-03 23:23

I would like to make a ProgressDialog cancelable by the back button but not by a screen tap. Currently I use setCancelable(true).

However, in

相关标签:
2条回答
  • 2021-02-03 23:43

    Try this it will help you:

    ProgressDialog pd = ProgressDialog.show(main.this, "", "Loading. Please wait...", true);
    pd.setCancelable(true);`
    
    0 讨论(0)
  • 2021-02-03 23:54

    Use setCanceledOnTouchOutside(false).

    0 讨论(0)
提交回复
热议问题