Page 4 - java
import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import androidx.activity.EdgeToEdge; import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; public class page4 extends AppCompatActivity { Intent i; String str_playerName; TextView tv_playerName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EdgeToEdge.enable(this); setContentView(R.layout.activity_page4); ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); return insets; }); tv_playerName = (TextView)findViewById(R.id.tv_playerName); i = getIntent(); str_playerName = i.getStringExtra("str_playerName"); tv_playerName.setText("Alongside " + str_playerName + " cookie, valiants cookie such as Pure Vanilla Cookie and Custard III Cookie battled the witches for 3 days straight."); } public void bt_next4 (View view) { Intent i = new Intent(this, page5.class); i.putExtra("str_playerName", str_playerName); startActivity(i); } public void bt_back4 (View view) { Intent i = new Intent(this, page3.class); i.putExtra("str_playerName", str_playerName); startActivity(i); } }
Leave a Comment