Action Bar compatibility has been added into support library, revision 18. It now has ActionBarActivity class for creating activities with Action Bar on older versions of An
The OP wants to know how can we put MenuItems in the ActionBar of PreferenceActivity for pre-Honeycomb because Android's support library has a bug which doesn't allow this to happen.
I've found a much cleaner way, than already proposed, to achieve the target (and found it in the Android Docs):
android:parentActivityNameThe class name of the logical parent of the activity. The name here must match the class name given to the corresponding element's android:name attribute.
The system reads this attribute to determine which activity should be started when the use presses the Up button in the action bar. The system can also use this information to synthesize a back stack of activities with TaskStackBuilder.
To support API levels 4 - 16, you can also declare the parent activity with a element that specifies a value for "android.support.PARENT_ACTIVITY". For example:
Now do what you would normally do in your onOptionsItemSelected(). Since it's a part of Android Docs, it has no side-affects.
Happy coding. :)
This solution no longer works if you're targeting Lollipop. If you're using AppCompat, this answer is what you should be looking for.