Handeling multiple Async actions consecutilvely

  • Replies:0
John Calvin
  • Forum posts: 1

Aug 7, 2017, 3:07:22 AM via Website

I am working on an android app and one of the areas that I am struggling with is on my setup fragment. I have a special fragment that gets run on the first run by the user and performs the following 3 operations, 1.downloading a database for my application 2.Getting permission to access fine location 3.Ensuring that the location settings are setup properly for the google play services to properly provide my application with an accurate location.

The problem is that all of these 3 tasks are performed Async, so what I did was I implemented each one of them on the previous one's callback method, the problem is that this makes the code very unneat and bug prone.

Do any of you know of a better way to do this?

Reply