-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainActivity.java
More file actions
58 lines (47 loc) · 1.87 KB
/
MainActivity.java
File metadata and controls
58 lines (47 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.example.hello.mytrack;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
private EditText txt1;
public static ArrayList<String> playerList = new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//txt1=(EditText)findViewById(R.id.edit);
Button button=(Button)findViewById(R.id.button);
// final TextView t1=(TextView)findViewById(R.id.hello);
/*button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String ag=txt1.getText().toString().trim();
if(ag.length() != 0){
playerList.add(ag);
txt1.setText(""); // adds text to arraylist and make edittext blank again
t1.setText(ag);
}
}
});*/
Button button1=(Button)findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(MainActivity.this,Main2Activity.class);
startActivity(intent);
}
});
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(MainActivity.this,Main3Activity.class);
startActivity(intent);
}
});
}
}