I\'m implementing n-layer PreferenceActivities 1st layer PreferenceActivity is loaded from preference-headers.
First header creates fragment of settings which is a P
if you are creating preferences using java ,then you can achieve the same result by,
PreferenceScreen editPhoneNumbersScreen = getPreferenceManager().createPreferenceScreen(mContext);
editPhoneNumbersScreen.setTitle(getResources().getString(R.string.change_add_emergency_numbers));
editPhoneNumbersScreen.setSummary(getResources().getString(R.string.summary_add_no));
Intent i = new Intent(getApplicationContext(),TargetActivity.class);
i.putExtra("change numbers", true);
editPhoneNumbersScreen.setIntent(i);
<header android:title="Intent"
android:summary="Launches an Intent.">
<intent android:targetPackage="com.mycompany.myapp"
android:targetClass="com.mycompany.myapp.ui.MyPreferenceActivity" /></header>
and add the below code in mainfest file
<activity android:name=".activities.MyActivity"
android:label="@string/my_activity_title"
android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="com.example.myapp.activities.MyActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
If you want to start an explicit Activity from your third preference then do this:
<intent android:targetPackage="com.mycompany.myapp"
android:targetClass="com.mycompany.myapp.ui.MyPreferenceActivity" />