startactivityforresult使用

与startactivity基本相同,不过需要传入(intent,int)第二个int为请求ID,用来识别

在该activity中还应该重写nActivityResult(int requestCode, int resultCode, Intent data)方法,该方法中的intent类型参数data可以取得返回值

开启的新activity可以调用setResult(RESULT_OK, intent)在结束时传回intent

u3coding
A software developer

Leave a Comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.