Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.mynumberspuzzle;
- import android.content.Intent;
- import android.os.Bundle;
- import android.view.View;
- import androidx.appcompat.app.AppCompatActivity;
- public class WellcomeActivity extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_wellcome);
- }
- public void startGame(View view) {
- int rows = 4;
- int cols = 4;
- switch (view.getId()) {
- case R.id.btnEasy:
- rows = 3;
- cols = 3;
- break;
- case R.id.btnMedium:
- rows = 4;
- cols = 4;
- break;
- case R.id.btnHard:
- rows = 5;
- cols = 5;
- break;
- }
- Intent intent = new Intent(this, MainActivity.class);
- intent.putExtra("ROWS_COUNT", rows);
- intent.putExtra("COLS_COUNT", cols);
- startActivity(intent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement