ProgressDialog not showing while performing a task

后端 未结 3 1689
青春惊慌失措
青春惊慌失措 2020-12-17 18:02

I have a backup routine that copies everything from one folder to an external SD card which works perfectly. I\'m trying to get an nice popup dialog box that shows when it\'

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 18:31

    Instead of doing this in one function at once. Do the following steps and it will definately work for you. 1. Create one async class.(It will create one separate thread for your copy directory functionality and wont run on main UI.) 2. Show your progress dialog before you execute the async class. 3. On post execute method, dismiss your dialog.

提交回复
热议问题