Activity1.Java
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void click1(View view){
Intent intent =new Intent(this,MainActivity.class);
startActivity(intent);
Log.i("Tag","页面一taskId:" + getTaskId());
}
public void click2(View view){
Intent intent =new Intent(this,MainActivity.class);
startActivity(intent);
Log.i("Tag","页面二taskId:"+getTaskId());
}
public void click3(View view){
Intent intent =new Intent(this,MainActivity.class);
startActivity(intent);
Log.i("Tag","页面三taskId:" + getTaskId());
}
}
- 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
- 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
Activity2.java
public class Main2Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
}
public void click1(View view){
Intent intent =new Intent(this,Main2Activity.class);
startActivity(intent);
Log.i("Tag","页面一taskId:" + getTaskId());
}
public void click2(View view){
Intent intent =new Intent(this,Main2Activity.class);
startActivity(intent);
Log.i("Tag","页面二taskId:"+getTaskId());
}
public void click3(View view){
Intent intent =new Intent(this,Main2Activity.class);
startActivity(intent);
Log.i("Tag","页面三taskId:" + getTaskId());
}
}
- 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
- 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
public class Main3Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main3);
}
public void click1(View view){
Intent intent =new Intent(this,Main3Activity.class);
startActivity(intent);
Log.i("Tag","页面一taskId:" + getTaskId());
}
public void click2(View view){
Intent intent =new Intent(this,Main3Activity.class);
startActivity(intent);
Log.i("Tag","页面二taskId:"+getTaskId());
}
public void click3(View view){
Intent intent =new Intent(this,Main3Activity.class);
startActivity(intent);
Log.i("Tag","页面三taskId:" + getTaskId());
}
}
- 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
- 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