Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/206.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何使用setResult()设置结果代码;方法_Android - Fatal编程技术网

Android 如何使用setResult()设置结果代码;方法

Android 如何使用setResult()设置结果代码;方法,android,Android,我正在寻找一个问题的答案,我们如何才能给启动我的应用程序的结果。 我参考了很多教程,但都没用。。。 欢迎任何帮助 Intent returnIntent = new Intent(); returnIntent.putExtra("result",result); setResult(RESULT_OK,returnIntent); finish(); 资料来源: 可能重复感谢来源..您好,您能在另一个主题上帮助我吗,即使用setTypeOkay设置意图类型。setType允许您指定包

我正在寻找一个问题的答案,我们如何才能给启动我的应用程序的结果。 我参考了很多教程,但都没用。。。 欢迎任何帮助

Intent returnIntent = new Intent();
returnIntent.putExtra("result",result); 
setResult(RESULT_OK,returnIntent);
finish();   
资料来源:


可能重复感谢来源..您好,您能在另一个主题上帮助我吗,即使用setTypeOkay设置意图类型。setType允许您指定包含在意图中的数据的MIME类型。纯文本的MIME类型为text/Plain。看一看:你能给我举个例子吗。。。。这不是一个大问题,但只是setType中的问题。假设我的意图使用MIME类型text/plain如何使用setType定义它,这就是我在示例中讨论的问题:
Intent i = new Intent();
i.setAction(Intent.ACTION_EDIT);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_TEXT,"Just some text");
startActivity(i);