Page 5 - 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 page5 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_page5); 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("Finally, " + str_playerName + " cookie manages to defeat the remaining witches in the Vanilla Kingdom at the cost of his life. Afterwards, the Vanilla Kingdom live happily ever after."); } public void bt_next5 (View view) { Intent i = new Intent(this, MainActivity.class); i.putExtra("str_playerName", str_playerName); startActivity(i); } public void bt_back5 (View view) { Intent i = new Intent(this, page4.class); i.putExtra("str_playerName", str_playerName); startActivity(i); } }
Leave a Comment