Ich habe eine Aktivität und Tow Fragmente. Wenn die Anwendung startet, lade ich Fragment eins in Aktivität.Ersetzen Sie das Fragment mit einem anderen
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_place"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
Ich habe Knopf im Fragment ein, und ich möchte, wenn darauf geklickt wurde, ersetzen Sie es mit dem Fragment Schlepptau (Last Elternfragment Container). Das Layout des Fragments ein und Schlepptau sind wie folgt aus:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/replace"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Replace" />
</FrameLayout>
ich Fehler und Anwendung stoppt. Ist es möglich, auf diese Weise zu tun?
Was ist die Frage? – F43nd1r
@ F43nd1r Ich habe die Frage bearbeitet. –
Jetzt gibt es eine Frage. Aber absolut keine Informationen zu deinem Problem. Wir brauchen Code und einen Stacktrace. Bitte beachten Sie http://stackoverflow.com/help/how-to-ask – F43nd1r