[Android Apps and Games] daxgirl:
Sooooooo here is my answer:

1. For 3-minit battery settings I have no idea why it's not showing for you. I just copied your preference screen item as you published it and it's showing immidiately. Make sure you have the app installed.

2. For the OTA app... Some apps have more complex package structure. It's very rare and against package structure convention to put main activity in subfolder. But evidently it does happen. So for apps like that we will need to actually use intent in screen preference:

Follow the steps:

In preference xml file:

<PreferenceScreen
android:summary="Check AryaMod Addons and Update"
android:title="OTA Updates">
<intent
android:targetClass="com.ota.updates.activities.MainActivity"
android:targetPackage="com.ota.updates" />
</PreferenceScreen>

In HandlePreferenceFragments

1. find a method called allGroups()

Before:

public void allGroups(Preference p) {
PreferenceScreen ps = (PreferenceScreen) p;
ps.setOnPreferenceClickListener(this);

/*Initiate icon view for preferences with keys that are interpreted as Intent
*For more info see OnPreferenceClick method*/
if (ps.getKey() != null) {
if (ps.getKey().contains(".")) {
int lastDot = ps.getKey().lastIndexOf(".");
String pkgName = ps.getKey().substring(0, lastDot);
try {
//if application package exists, we will set the icon successfully
Drawable icon = c.getPackageManager().getApplicationIcon(pkgName);
ps.setIcon(icon);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
/*In case of exception, icon will not be set and we will remove the preference to avoid crashes on clicks
*To find the parent for each preference screen we use HashMap to buil the parent tree*/
Map<Preference, PreferenceScreen> preferenceParentTree = buildPreferenceParentTree();
PreferenceScreen preferenceParent = preferenceParentTree.get(ps);
preferenceParent.removePreference(ps);

}
}
}

for (int i = 0; i < ps.getPreferenceCount(); i++) {
Preference p1 = ps.getPreference(i);
if (p1 instanceof PreferenceScreen) {
/*As we descend further on a preference tree, if we meet another PreferenceScreen, we repeat the allGroups method.
*This method will loop untill we don't have nested screeens anymore.*/
allGroups(p1);

}
}
}

After (add the blue):

public void allGroups(Preference p) {
PreferenceScreen ps = (PreferenceScreen) p;
ps.setOnPreferenceClickListener(this);

[COLOR="Blue"][B] if(ps.getIntent()!=null){
Intent intent = ps.getIntent();
try {
Drawable iconFromIntent = c.getPackageManager().getActivityIcon(intent);
ps.setIcon(iconFromIntent);
} catch (PackageManager.NameNotFoundException e) {
Map<Preference, PreferenceScreen> preferenceParentTree = buildPreferenceParentTree();
PreferenceScreen preferenceParent = preferenceParentTree.get(ps);
preferenceParent.removePreference(ps);
}
}
[/B][/COLOR]
/*Initiate icon view for preferences with keys that are interpreted as Intent
*For more info see OnPreferenceClick method*/
if (ps.getKey() != null) {
if (ps.getKey().contains(".")) {
int lastDot = ps.getKey().lastIndexOf(".");
String pkgName = ps.getKey().substring(0, lastDot);
try {
//if application package exists, we will set the icon successfully
Drawable icon = c.getPackageManager().getApplicationIcon(pkgName);
ps.setIcon(icon);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
/*In case of exception, icon will not be set and we will remove the preference to avoid crashes on clicks
*To find the parent for each preference screen we use HashMap to buil the parent tree*/
Map<Preference, PreferenceScreen> preferenceParentTree = buildPreferenceParentTree();
PreferenceScreen preferenceParent = preferenceParentTree.get(ps);
preferenceParent.removePreference(ps);

}
}
}

for (int i = 0; i < ps.getPreferenceCount(); i++) {
Preference p1 = ps.getPreference(i);
if (p1 instanceof PreferenceScreen) {
/*As we descend further on a preference tree, if we meet another PreferenceScreen, we repeat the allGroups method.
*This method will loop untill we don't have nested screeens anymore.*/
allGroups(p1);

}
}
}

2. Find method called public boolean onPreferenceClick(Preference preference)

Before:

Scroll to the end of it and find this code. Note the red, we will remove it!!!:

/*If preference key contains a dot ".", we assume the dev meant to create an intent to another app
* As per instructions, devs are required to enter full path to the main activity they wish to open in the intended app.
* In the following condition the key is broken down to package name and class name (full key)
* and we attempt to build intent.
* We know from the allGroups() method that if the intent is not valid, the preference will not show at all.
* Nevertheless. as precaution we catch an exception and show a toast that the app is not installed.*/
} else if (preference.getKey() != null && preference.getKey().contains(".")) {
String cls = preference.getKey();
String pkg = cls.substring(0, cls.lastIndexOf("."));
Intent intent = new Intent(Intent.ACTION_MAIN).setClassName(pkg,
cls).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.setComponent(new ComponentName(pkg,
cls));
try {
c.startActivity(intent);
} catch (ActivityNotFoundException anf) {
Toast.makeText(c, "App not installed or intent not valid", Toast.LENGTH_SHORT).show();
}

} [COLOR="Red"][B]else if (preference.getKey() == null) {
// setToolbarForNested(preference);
}[/B][/COLOR]
return true;
}

After (add the blue code, make sure you first removed the red!!!)

/*If preference key contains a dot ".", we assume the dev meant to create an intent to another app
* As per instructions, devs are required to enter full path to the main activity they wish to open in the intended app.
* In the following condition the key is broken down to package name and class name (full key)
* and we attempt to build intent.
* We know from the allGroups() method that if the intent is not valid, the preference will not show at all.
* Nevertheless. as precaution we catch an exception and show a toast that the app is not installed.*/
} else if (preference.getKey() != null && preference.getKey().contains(".")) {
String cls = preference.getKey();
String pkg = cls.substring(0, cls.lastIndexOf("."));
Intent intent = new Intent(Intent.ACTION_MAIN).setClassName(pkg,
cls).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.setComponent(new ComponentName(pkg,
cls));
try {
c.startActivity(intent);
} catch (ActivityNotFoundException anf) {
Toast.makeText(c, "App not installed or intent not valid", Toast.LENGTH_SHORT).show();
}

} [COLOR="Blue"][B]else if (preference.getKey() == null && preference.getIntent()!=null) {
Intent intentFromPreference = preference.getIntent();
c.startActivity(intentFromPreference);
}[/B][/COLOR]
return true;
}