how to reflect instant change on activity android
I am currently working on calendar application , in which when I add a event which is added in google calendar to show that event instantly on screen I am using recreate() method of activity which fetches all event and display it again but while this process screen turn in black , which is vary bad UI experience , how I can solve this issue , I want something like google calendar where events are instantly added. thanks
If your calendar uses an adapter for displaying items you can change the data in the adapter and invoke adapter.notifyDataSetChanged(). It notifies the attached observers that the underlying data has been changed and any View reflecting the data will be refreshed with the new values from the adapter.
Use ProgressDialog to keep the user "engaged" while you fetch new Calendar data and then take a look at this Should give you an idea of how to recreate an Activity.