What I am doing is starting the stream, when the button is pressed inside the fragment, and in Back click, my activity and fragment will be destroyed, but when this activity and fragment are called again, I want to start my stream again from the previous state.
I know that I do not provide much information, but I am too much confused by what I ask.
So kindly help me.
Here is what i know
thread = new Thread(new Runnable() { @Override public void run() { while (runThread) { try { getActivity().runOnUiThread(new Runnable() { @Override public void run() { updateProgress(); } }); Thread.sleep(200); } catch (InterruptedException e) {
here is my onDestroy
@Override public void onDestroyView() { // TODO Auto-generated method stub super.onDestroyView(); try { if (thread != null) { runThread = false; } else { } } catch (Exception e) { } }
source share