Android : Theme.Holo VS Theme.AppCompat

Denis picture Denis · Apr 25, 2016 · Viewed 8.6k times · Source

I use "@android:style/Theme.Holo" as my game's theme :

enter image description here

But to be able to set up a snackbar widget, I have no choice but using "@style/Theme.AppCompat", otherwise I get this error message :

You need to use a Theme.AppCompat theme (or descendant) with the design library

The problem is that the "@style/Theme.AppCompat" is visually quite different :

enter image description here

What could I do to stay with the same visual as "@android:style/Theme.Holo", but in the same time be able to use a snackbar widget?

EDIT With the Yoann Hercouet's solution, here is the result :

enter image description here

What is missing?

Answer

Denis picture Denis · Apr 25, 2016

I finally found the solution :

AndroidManifest.xml :

<application
    android:theme="@style/Theme.AppCompat"
    ...

MyDialog.java :

new AlertDialog.Builder(new ContextThemeWrapper(context, android.R.style.Theme_Holo_Dialog));

Instead of :

new AlertDialog.Builder(context);