使用意图传递数据 [英] Using intents for passing data

查看:131
本文介绍了使用意图传递数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你如何从一个活动发送数据到另一个使用意图。

How do you send data from one activity to another using intents.

(注意,这是一个两部分的问题,发送和接收)。

(Note this is a two-part question, the sending and the receiving).

我创建一个表单,并且我要救的答案,每一个问题,在SQLite数据库。

I'm creating a form, and I want to save the answers to every question in an sqlite database.

推荐答案

您可以轻松地通过使用捆绑的数据。

You can pass data easily using Bundle.

Bundle b=new Bundle();
b.putString("key", value);

Intent intent=new Intent(TopicListController.this,UnitConverter.class);
intent.putExtras(b);

startActivity(intent);

您可以在其他活动免费获赠这样的数据如下:

You can recieve data in your other activity like this as follow:

Bundle b=this.getIntent().getExtras();
String s=b.getString("select");

这篇关于使用意图传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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