Set a theme on a View programmatically on Android 5.0 Lollipop

android:theme changes specific
attributes specified in the theme resource. You
could instantiate specific view using any
overloaded constructor, like View(Context
context, AttributeSet attrs, int defStyleAttr, int
defStyleRes). which basically is what
inflater does.

For example v7.widget.Toolbar
tries to create themed context out of resource
android:themeright in the super call
of the constructor, which is more or less what I
mentioned above. Only certain widgets override
application theme using
android:theme.

I'm not sure if is possible to directly specify
theme, rather than instantiation mentioned above,
or using supported individual attribute and its
related method.

It' s simple. Just apply the Theme.AppCompat.xxx to your activity and
put your PreferenceFragment in that activity if you use the Api level
>= 11.
EDIT
for the lastest supoort libary appcompat-v7, google provides
AppCompatDelegate to do the trick, here is the sample code from
google.

Sqlite 3.8 introduced the Next Generation Query Planner. It may make
different choices, but is supposed to be better.
(I'm assuming here that the query plans for your query differ in a
significant way between sqlite versions. You've only posted one of
them.)
Allow me to quote an excerpt from the docs on the new planner,
"Hazards of upgrading to NGQP":
But as with any query planner change, up

The package name of Lollipop's dialer is com.google.android.dialer (on
Nexus devices at least).
If you really want to hardcode the package name, you may have to
detect which dialer is available on the device.