ANR Genrated : Local Database data load is not working properly in android

38 Views Asked by At

I have one query regarding the local database. As my system works, when the user logs in for the first time in the application that time in the dashboard we get an API call for getting data. But in this case, our API call response is so much bigger like response size is something like 3 to 4 MB and response line like 15K+, And we are storing this all data in our local database. But sometimes it takes an ANR error when we are storing data in the database. Our data is stored in the background using a broadcast receiver and we insert data using an async task we use the bulk insert for insert data so we store all data at the same time. We are also using an executor for a background process.

image

This issue only occurs when data is taking more time to load data in the database. what can I use for this fix? is there any way to change the default ANR timing?

0

There are 0 best solutions below