layout_content.xml in android Datenbindung enthalten Layout
<layout>
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
/>
</android.support.design.widget.AppBarLayout>
</layout>
layout_main.xml
<layout>
<android.support.v4.widget.DrawerLayout
android:id="@+id/dl_main_drawer"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<include layout="@layout/layout_content" android:id="@+id/content"/>
</android.support.v4.widget.DrawerLayout>
</layout>
MainActivity.java
'kann nicht Symbolvariable finden'LayoutMainBinding binding = DataBindingUtil.setContentView(this,R.layout.layout_main);
setSupportActionBar(binding.content.toolbar);
Android Studio Intellisense Check binding.content ist ViewDataBinding obj
aber Fehler bauen Wird dies irgendein Problem 'nicht Symbolvariable Inhalt finden können'? Danke!
Ist dies mit rc1 oder rc0? –
Ich benutze rc1. und Gradle ist 1.3.0-beta4 – tatsuyuki
Dies passiert, wenn Sie eine Layout-Datei umbenannt haben und die alte generierte Binding-Klasse immer noch herumhängt. Wählen Sie "Build-> Clean Project" und kompilieren Sie es erneut. –