如何从onpostexecute方法使用的意图传递结果另一个活动 [英] How to pass result from onpostexecute method to another activity using intent

查看:203
本文介绍了如何从onpostexecute方法使用的意图传递结果另一个活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何从传递的方法onpostexecute到另一个活动或到onCreate方法使用的意图得到的结果。


解决方案

 公共无效onPostExecute(字符串结果){     意向意图=新意图(ThisActivity.this,TargetActivity.class);
     intent.putExtra(YourData,结果);
     StartActivity(意向)}

并通过 getIntent得到它在另一个活动()

How i pass the result obtained from onpostexecute method to another activity or into oncreate method using intent

解决方案

public void onPostExecute(String result){

     Intent intent = new Intent(ThisActivity.this, TargetActivity.class);
     intent.putExtra("YourData", result);
     StartActivity(intent)

}

and get it in another activity via getIntent()

这篇关于如何从onpostexecute方法使用的意图传递结果另一个活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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