9
I am building application for tab.
- On click of button I am trying to show Activity (say A) with theme
@android:style/Theme.Dialog - Inside activity A I am creating actionbar and adding 4 tabs.
- On click of tab I want to change fragment.
Everything works fine until I am not applying theme @android:style/Theme.Dialog
After applying theme I am getting exception:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ebuilder/com.ebuilder.views.MyTabActivity}: java.lang.NullPointerException
at following line:
actionBar.addTab(actionBar.newTab().setCustomView(R.layout.tab_home).
setTabListener(homeListener), 0);
I have two questions:
1. What is going wrong if I apply theme dialog?
2. Is my approach right?
Let me know if anybody know another approach.
Edit1: *Manifest file*
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vivek"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:targetSdkVersion="14"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".FragmentInsideFragmentTestActivity"
android:label="@string/app_name"
android:theme="@style/Theme.CustomDialog" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
res/values/style.