点击站点后,将站点名传值给站点信息界面
This commit is contained in:
parent
a4d64af0f7
commit
b7f31eb7de
|
@ -127,6 +127,7 @@ public class MyAdapter extends RecyclerView.Adapter<MyViewHolder>{
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
//todo 站点信息
|
//todo 站点信息
|
||||||
Intent intent = new Intent(Station.this,StationMessage.class);
|
Intent intent = new Intent(Station.this,StationMessage.class);
|
||||||
|
intent.putExtra("name",station_item.stationName);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,6 +16,11 @@ public class StationMessage extends AppCompatActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_station_message);
|
setContentView(R.layout.activity_station_message);
|
||||||
|
//TODO 值的传递
|
||||||
|
String name = getIntent().getStringExtra("name");
|
||||||
|
TextView textView = findViewById(R.id.textView17);
|
||||||
|
textView.setText(name);
|
||||||
|
|
||||||
getSupportFragmentManager().beginTransaction().add(R.id.layout,stationDetailMessage).commit();
|
getSupportFragmentManager().beginTransaction().add(R.id.layout,stationDetailMessage).commit();
|
||||||
getSupportFragmentManager().beginTransaction().add(R.id.layout,stationFacility).commit();
|
getSupportFragmentManager().beginTransaction().add(R.id.layout,stationFacility).commit();
|
||||||
getSupportFragmentManager().beginTransaction().hide(stationFacility).show(stationDetailMessage).commit();
|
getSupportFragmentManager().beginTransaction().hide(stationFacility).show(stationDetailMessage).commit();
|
||||||
|
|
Loading…
Reference in New Issue