Add run() to change tv_path.Text
This commit is contained in:
@ -17,6 +17,16 @@ public class MainActivity extends AppCompatActivity {
|
||||
tvPath = findViewById(R.id.tv_path1);
|
||||
}
|
||||
|
||||
private void run(Intent intent) {
|
||||
tvPath.setText(intent.getCharSequenceExtra("path"));
|
||||
if (tvPath.getText().equals("")) {
|
||||
tvPath.setText("1");
|
||||
}
|
||||
else {
|
||||
tvPath.setText(tvPath.getText() + " -> 1");
|
||||
}
|
||||
}
|
||||
|
||||
public void goBack (View v) {
|
||||
finish();
|
||||
}
|
||||
|
@ -17,6 +17,11 @@ public class SecondActivity extends AppCompatActivity {
|
||||
tvPath = findViewById(R.id.tv_path2);
|
||||
}
|
||||
|
||||
private void run(Intent intent) {
|
||||
tvPath.setText(intent.getCharSequenceExtra("path"));
|
||||
tvPath.setText(tvPath.getText() + " -> 2");
|
||||
}
|
||||
|
||||
public void goBack (View v) {
|
||||
finish();
|
||||
}
|
||||
|
@ -17,6 +17,11 @@ public class ThirdActivity extends AppCompatActivity {
|
||||
tvPath = findViewById(R.id.tv_path3);
|
||||
}
|
||||
|
||||
private void run(Intent intent) {
|
||||
tvPath.setText(intent.getCharSequenceExtra("path"));
|
||||
tvPath.setText(tvPath.getText() + " -> 3");
|
||||
}
|
||||
|
||||
public void goBack (View v) {
|
||||
finish();
|
||||
}
|
||||
|
Reference in New Issue
Block a user