Activity 中通过Intent来传递数据:实例:
Intent intent = new Intent(FollowInSelectActivity.this, InfoEnterActivity.class); intent.putExtra("custid", custId1); intent.putExtra("editable", true); intent.putExtra("from", ""); startActivity(intent);然后startActivity;
接收端为Activity:
直接getIntent().getStringExtra("名字”)
一下是判断控制新的Activity的显示样式
if (getIntent() != null) { if (getIntent().getStringExtra("from") != null) { from = getIntent().getStringExtra("from"); if (from.equals("ordercheck")) { title.setText("初审单审核"); save.setText("拒 绝"); post.setText("通 过"); } else if (from.equals("datachange")) { title.setText("数据修改"); } else if (from.equals("finalJudge") || from.equals("check")) { title.setText("审核部审核"); save.setText("拒 绝"); post.setText("通 过"); }else if(from.equals("index")){ title.setText("信息详情"); save.setVisibility(View.GONE); post.setVisibility(View.GONE); } } else { title.setText("信息录入"); } }最总结果为 “信息输入”
最后致敬Strarry大神