会有人请解释RESULT_FIRST_USER [英] Will someone please explain RESULT_FIRST_USER

查看:1366
本文介绍了会有人请解释RESULT_FIRST_USER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白其中的含义,价值,或RESULT_FIRST_USER的重要性,除此之外我自己的结果codeS必须大于 1 。会有人请解释一下吗? RESULT_OK和RESULT_CANCELED鲜明了意义讲英语的人。但在Android的世界是什么RESULT_FIRST_USER?所有单证说,大约是

 启动用户自定义的活动的结果。
 

解决方案

当你完成一个活动,你可以叫的setResult(RESULT_ code)发送回数据到另一个活动。如果你不调用这个方法,默认值将是 RESULT_FIRST_USER

返回数据的例子:

 意向意图=新的意图();
intent.putExtra(数据,数据);
的setResult(YOUR_RESULT_ code,意图);
完();
 

I don't understand the meaning, value, or importance of RESULT_FIRST_USER, other than that my own result codes must be greater than 1. Will someone please explain it? RESULT_OK and RESULT_CANCELED make perfect sense to an english speaker. But what in the world of android is RESULT_FIRST_USER? All the documentations says about it is

Start of user-defined activity results.

解决方案

When you finish an activity, you can call setResult(RESULT_CODE) to send back data to another activity. If you don't call this method, the default value will be RESULT_FIRST_USER

Example of returning data:

Intent intent= new Intent();
intent.putExtra("data",data);
setResult(YOUR_RESULT_CODE,intent);
finish();

这篇关于会有人请解释RESULT_FIRST_USER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆