Да, я знаю, эта проблема была опубликована снова и снова здесь. Но я не могу найти решение моей конкретной проблемы.Вам нужно использовать тему Theme.AppCompat
Каждый раз, когда я пытаюсь сделать закусочной, мое приложение падает с
You need to use a Theme.AppCompat theme (or descendant) with the design library.
Ok. Я не знаю: нет отладку без кода, так:
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>
Ах да: AppTheme и AppTheme.NoActionbar оба родители Theme.AppCompat ...
Если вам нужно больше кода, просто скажите мне.
Добавить 'Рез/значения/styles.xml' и'/Рез значения-V21/стили .xml' (если у вас есть), пожалуйста –