[android]代码库
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(MainActivity.this,Main2Activity.class);
startActivityForResult(intent,101);
Log.d("zzz","按钮监听");
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode==101&&resultCode==102){
String one=data.getStringExtra("phone");
name.setText(one);
}
}
//
Intent intent=new Intent();
intent.putExtra("phone",ipone);
setResult(102,intent);
finish();
by: 发表于:2017-09-27 10:01:28 顶(0) | 踩(0) 回复
??
回复评论