このステートメントでは、コンテンツの意味は何ですか?
fragmentTransaction.replace(android.R.id.content, fragment1);
これは、Android Developers フラグメントの例の 1 つからのものです。
このステートメントでは、コンテンツの意味は何ですか?
fragmentTransaction.replace(android.R.id.content, fragment1);
これは、Android Developers フラグメントの例の 1 つからのものです。
通常、ViewGroup
フラグメントをアタッチするのは です。例えば:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
このコードは、fragment_container
ビューにあるものをnewFragment
.
transaction.replace(R.id.fragment_container, newFragment);