Here is my code:
@Override
public void onSaveInstanceState(Bundle savedInstanceStateBundle)
{
savedInstanceStateBundle.putInt(AVERAGE_SESSION_VALUE_HOLDER, averageSessionSeek.getProgress());
savedInstanceStateBundle.putInt(CONFIDENCE_VALUE_HOLDER, confidenceSeek.getProgress());
savedInstanceStateBundle.putInt(CONVERSION_TIME_VALUE_HOLDER, conersionTimeSeek.getProgress());
}
Above code is belongs to InputFragment.java
which extends Fragment
. The above methods saves the state of instances so when the user navigate away from that particular Fragment
and come back to it, the instances are restored. I tried it with the below code
@Override
public void onRestoreInstanceState(Bundle savedInstanceStateBundle)
{
}
But it fails, compile errors. So, how can I reload the instance states in Fragments
?