I have a tabhost widget which starts different activies by using Intents.
TabSpec tab = mTabHost.newTabSpec("profile");
tab.setIndicator("profile");
Intent i3 = new Intent(ctx, ProfileActivity.class);
tab.setContent(i3);
mTabHost.addTab(tab);
All childs are defined as embeded:
<activity android:exported="false" android:name="com.example.app.ProfileActivity" android:label="ProfileActivity view">
<intent-filter>
<category android:name="android.intent.category.EMBED"></category>
<action android:name="android.intent.action.MAIN"></action>
</intent-filter>
</activity>
Unfortunately I can see an occasional crash inside my ProfileActivity onResume function.
It crashes on this line, because getParent()
returns null.
((MainActivity) getParent()).goToTab("splash")
It's not happening all the time - it's very occasional.
Anyone had this problem?