public class MyTabActivity extends TabActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
dataManager = DataManager.getInstance(getApplicationContext());
}
}
I have a tab activity as shown above. It works fine on the initial run. After some time in the background where it's activity is deleted from memory, when you reopen the app, it will crash. The reason is because getApplicationContext() returns null.
I use this same setup in other Activities with no problems. I can't find anywhere in the documentation that says when/why/if it would return null.