---
title: "android startActivityForResult"
author: "staroflife"
date: "2012-12-25T09:02:39Z"
tags: []
categories: ["移动开发"]
slug: "android-startactivityforresult"
draft: false
lastmod: "2012-12-25T09:02:39Z"
id: 1753462
url: "https://staroflife.iteye.com/blog/1753462"
---

Bashboard.java
Intent i = new Intent(this, NewAccount.class);
startActivityForResult(i, 0);

onActivityResult(......){
 if(data!=null){
   Bundle bundle=data.getExtras();
   .........
 }
}



NewAccount.java
Bundle bundle = new Bundle();
bundle.putString("returnStatus", action);
Intent mIntent = new Intent();
mIntent.putExtras(bundle);
setResult(RESULT_OK, mIntent);
finish();