How to perform database operations using Async Task

前端 未结 2 546
难免孤独
难免孤独 2020-12-15 06:15

My application is getting stuck while performing database operation after googling for solutions it was suggested that I use AsyncTask so that main thread doesn\'t get block

2条回答
  •  悲哀的现实
    2020-12-15 07:09

    No, you can't extend a class from multiple classes as it violates the property of java because java doesn't support multiple inheritence so for your case you have to create a new class which will extend ASyncTask and override the abstract methods to perform all the database related operations. Thank you

提交回复
热议问题