fix issues

This commit is contained in:
Matthias Schreiner 2019-06-24 10:26:01 +03:00
parent 3873885197
commit 433fde7888
1 changed files with 15 additions and 1 deletions

View File

@ -27,6 +27,7 @@ public class HomeFragment extends Fragment {
private Context context; private Context context;
private Handler handler; private Handler handler;
private Runnable runnableCode;
private SharedPreferences preferences; private SharedPreferences preferences;
@Nullable @Nullable
@ -47,7 +48,7 @@ public class HomeFragment extends Fragment {
// Create the Handler object (on the main thread by default) // Create the Handler object (on the main thread by default)
handler = new Handler(); handler = new Handler();
// Define the code block to be executed // Define the code block to be executed
Runnable runnableCode = new Runnable() { runnableCode = new Runnable() {
@Override @Override
public void run() { public void run() {
@ -65,4 +66,17 @@ public class HomeFragment extends Fragment {
return view; return view;
} }
@Override
public void onResume() {
super.onResume();
}
@Override
public void onPause() {
handler.removeCallbacks(runnableCode);
super.onPause();
}
} }