P
pagrf
Neues Mitglied
- 0
Hallo,
da ich nun einen großen Schritt gemacht habe ist nu ein Weiteres Problem aufgetreten. Ich habe ein Fragment erstellt in welchem ich Buttons habe und dort ein ScrollView einbinden möchte. Nun zeigt mir Logcat folgenden Fehler:
at com.example.langlaufendeutschland.bayern_fragment.onCreateView(bayern_fragment.java:16) (Das ist die Zeile, in der das hier steht:
)
Anbei die XML Datei und die Class vom Fragment:
XML:
Fragment Class:
da ich nun einen großen Schritt gemacht habe ist nu ein Weiteres Problem aufgetreten. Ich habe ein Fragment erstellt in welchem ich Buttons habe und dort ein ScrollView einbinden möchte. Nun zeigt mir Logcat folgenden Fehler:
at com.example.langlaufendeutschland.bayern_fragment.onCreateView(bayern_fragment.java:16) (Das ist die Zeile, in der das hier steht:
Code:
View view = inflater.inflate (R.layout.fragment_bayern, container,false );
Anbei die XML Datei und die Class vom Fragment:
XML:
Code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity"
tools:openDrawer="start">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/editText3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="1"
android:inputType="textPersonName"
android:text="text"
android:gravity="center|center_vertical"
/>
<Button
android:id="@+id/button1"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:layout_marginTop="0dp"
android:textAllCaps="false"
android:text="text"
/>
<Button
android:id="@+id/button2"
style="@style/Widget.AppCompat.Button.Borderless"
android:gravity="left|center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAllCaps="false"
android:text="text" />
</LinearLayout>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example...MainActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
Fragment Class:
Code:
public class bayern_fragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate (R.layout.fragment_bayern, container,false );
return view;
}
}
Code: