This repository has been archived on 2025-12-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
tictactoeapp/app/src/main/java/com/example/tictactoeapplut/MainActivity.java
AndrewTrieu f6062b2302 Final
2022-06-20 13:08:58 +07:00

50 lines
1.7 KiB
Java

package com.example.tictactoeapplut;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView description = (TextView) findViewById(R.id.textView2);
TextView link = (TextView) findViewById(R.id.textView3);
description.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri lut = Uri.parse((String)"https://www.lut.fi/en");
Intent toLUT = new Intent(Intent.ACTION_VIEW, lut);
if (toLUT.resolveActivity(getPackageManager()) != null) {
startActivity(toLUT);
}
}
});
link.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri github = Uri.parse((String)"https://github.com/AndrewTrieu/tictactoeapp");
Intent toGitHub = new Intent(Intent.ACTION_VIEW, github);
if (toGitHub.resolveActivity(getPackageManager()) != null) {
startActivity(toGitHub);
}
}
});
}
public void startClick(View view){
Intent intent = new Intent(this, Prepare.class);
startActivity(intent);
}
public void recordClick(View view){
Intent intent = new Intent(this, ListDataActivity.class);
startActivity(intent);
}
}