Download 1076LAB-master/MainActivity.java from Dorothydu/gitrepo_20: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/datasets/Dorothydu/gitrepo_20/resolve/main/1076LAB-master/MainActivity.java
- Command line
-
hf download hf://datasets/Dorothydu/gitrepo_20/1076LAB-master/MainActivity.java
-
curl -L -o MainActivity.java https://huggingface.co/datasets/Dorothydu/gitrepo_20/resolve/main/1076LAB-master/MainActivity.java
1.4 kB
| package com.example.app0710807_1; | |
| import androidx.appcompat.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.EditText; | |
| import android.widget.TextView; | |
| public class MainActivity extends AppCompatActivity { | |
| TextView textView; | |
| Button Button_SET; | |
| Button Button_RESET; | |
| EditText editText; | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| textView = (TextView)findViewById(R.id.textView); | |
| textView.setText("Hello"); | |
| editText = (EditText)findViewById(R.id.editText) ; | |
| Button_SET = (Button)findViewById(R.id.button_SET); | |
| Button_SET.setText("SET"); | |
| Button_SET.setOnClickListener(new View.OnClickListener(){ | |
| public void onClick(View v){ | |
| textView.setText("Welcome to Android, " + editText.getText().toString()); | |
| } | |
| }); | |
| Button_RESET = (Button)findViewById(R.id.button_RESET); | |
| Button_RESET.setText("RESET"); | |
| Button_RESET.setOnClickListener(new View.OnClickListener(){ | |
| public void onClick(View v){ | |
| textView.setText("Hello World!"); | |
| } | |
| }); | |
| } | |
| } |