//设置button的点击事件
bt1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(intent.ACTION_GET_CONTENT);
startActivityForResult(intent, 1);
}
});
//重写onActivityResult
public void onActivityResult(int requestCode, int resultCode,
final Intent data) {
if (RESULT_OK == resultCode && 1 == requestCode) {
//做某些事情
...
super.onActivityResult(requestCode, resultCode, data);
}