从获得第一个活动数据在Android的第四项活动 [英] getting data from first activity to fourth activity in android

查看:82
本文介绍了从获得第一个活动数据在Android的第四项活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想文字写成的EditText第一个活动,并设置文本到另一个的EditText这是第四次活动​​。

i want to get text written in the EditText first activity and set that text to the another EditText which is fourth activity.

推荐答案

使用这种code在你的第一个活动。

Use this code in your first activity

Intent intent = new Intent(context,Viewnotification.class);
          intent.putExtra("Value1", youredittextvalue.getText().toString());
startActiviy(intent);

而在你的第四个活动

And in your fourth Activity

Bundle extras = getIntent().getExtras();
        String value1 = extras.getString("Value1");
yourfourthactivityedittext.setText(value1);

这篇关于从获得第一个活动数据在Android的第四项活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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