Reputation: 310
There's any way to call a activity and when it's appear to the user, load the elements in it? Something like facebook, when you go to any screen, it's appear and after load the contents (example below). Everytime I call my activity, it takes 2 seconds to appear.
Upvotes: 1
Views: 957
Reputation: 70
make your main views visibility gone
and replace that with some default views and then use asynctask
and load your data in doInBackground()
method. then make your main views visible
again and default views gone
in onPostExecute()
method
also you can simply change your views background before and after data loading in asynctask
Upvotes: 1
Reputation: 234
You can make your content view hidden till data is loaded then set visibility with visible , add loading layout visible till data is loaded then make it gone when your data load
Upvotes: 1