Yes, I know, this problem was posted again and again here. But I can't find any solution to my specific problem.
Every time I try to make a Snackbar, my App crashes with
You need to use a Theme.AppCompat theme (or descendant) with the design library.
Ok. I know: no debugging without the code, so:
The call, and line that throws the error:
Snackbar.make(
new CoordinatorLayout(getApplicationContext()),
"Logged out.",
Snackbar.LENGTH_SHORT).show();
The class definition:
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
Beginning of the manifest
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
Oh yeah: The AppTheme and AppTheme.NoActionbar are both parents of Theme.AppCompat...
If you need anymore code, just tell me.
res/values/styles.xml
andres/values-v21/styles.xml
(if you have it), please