xml1布局构思
xml2布局构思
xml3布局构思
Mainactivity.java
private String message_to_cpjl = "From Staff : Hello Product manager! What's our tasks?"; private String message_to_laoban = "From Staff : Hello Boss! I feel ill. Can I go on vacation?"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tocpjl = (TextView) findViewById(R.id.staff); btnjl = (Button) findViewById(R.id.btntojl); btnjl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getApplicationContext(),Main2Activity.class); intent.putExtra("001", message_to_cpjl); startActivityForResult(intent,0x01); } }); btnlb = (Button) findViewById(R.id.btntolb); btnlb.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getApplicationContext(),Main3Activity.class); intent.putExtra("003",message_to_laoban); startActivityForResult(intent,0x02); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==0x01){ String extra = data.getStringExtra("002"); tocpjl.setText(extra); } if(requestCode==0x02){ String extra = data.getStringExtra("003"); tocpjl.setText(extra); } }
Mainactivity2.java
private String message_to_staff = "From Product manager : Hello Staff ! We should solve these proplems together."; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); rece = (TextView) findViewById(R.id.recefromyg); rece.setText(getIntent().getStringExtra("001")); backbtn = (Button) findViewById(R.id.btntoyg); backbtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent =new Intent(getApplicationContext(),MainActivity.class); intent.putExtra("002", message_to_staff); setResult(RESULT_OK,intent); finish(); } });
Mainactivity3.java
private String message_to_staff = "From Boss : Hello Staff ! You can go home right now."; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3); rece = (TextView) findViewById(R.id.recefromyg); rece.setText(getIntent().getStringExtra("003")); backbtn = (Button) findViewById(R.id.btntoyg); backbtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent =new Intent(getApplicationContext(),MainActivity.class); intent.putExtra("003", message_to_staff.toString()); setResult(RESULT_OK,intent); finish(); } });
App设计效果图
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算