I have used a Fragment
to perform the background update of the app avoiding interruption if the activity is destroyed or paused.
Following this sample
the update task start in
if (mTaskFragment == null) {
mTaskFragment = new TaskFragment();
fm.beginTransaction().add(mTaskFragment, TAG_TASK_FRAGMENT).commit();
}
and works fine.
My problem is that I want to allow the user to update the data using a Button updateButton
but I haven't clear how could tell the TaskFragment to update again its task (e.g. the DummyTask
in the linked sample).
Any suggestion?