package org.ntlab.irisclient; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import android.os.Bundle; public class GameMemberActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_member_game); FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); // BackStackを設定 fragmentTransaction.addToBackStack(null); // パラメータを設定 fragmentTransaction.replace(R.id.container, DrawingCardFragment.newInstance("Fragment")); fragmentTransaction.commit(); } }