Progress Dialog crashes in async task

后端 未结 2 1296
走了就别回头了
走了就别回头了 2021-01-26 03:10

As the title says the app crashes when encounters the progress dialog create instruction. The context is passed to async class through constructor.

public class          


        
相关标签:
2条回答
  • 2021-01-26 03:18

    The problem was found in the passage of the ApplicationContext instead at Activity.

    0 讨论(0)
  • 2021-01-26 03:24

    You have to pass Activity context to create dialog as

     Activity context = null;
    
     public URLDataReader(Activity context){
            this.context = context;
      }
    

    Hope this will helps you.

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