when I start the app the first time the code below works just fine. But when leaving the app and opening it again I get an error saying getActivity() returns null.
I'm doing this code in a Fragment:
(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
enableMenu();
openMenu();
navigateToFragment(new BlankFragment());
}
});
What to do ?
How can I get the Activity ?