Page6.java

 avatar
unknown
java
23 days ago
1.8 kB
7
Indexable
package com.example.kingdom_iguiron;

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 Page6 extends AppCompatActivity {
    String str_charName;
    Intent goToPage6;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_page6);
        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;
        });
        goToPage6 = getIntent();
        str_charName = goToPage6.getStringExtra("str_charName");

        TextView storyTextView = findViewById(R.id.storyTextView);
        String story = "In a climactic battle, the gamer leads the charge against the cabal. Using his knowledge of the game’s strategy, he turns the tide of battle." + str_charName + "fights fiercely by his side, and together they defeat the enemy. As peace returns, the gamer realizes he cannot stay in this world. A portal opens, calling him back home. With a heavy heart, he bids farewell to " + str_charName + ", who promises to remember him always.";
        storyTextView.setText(story);
    }
    public void back(View v) {
        Intent fromTheStart = new Intent(this, MainActivity.class);
        startActivity(fromTheStart);
    }
}
Leave a Comment