通过从一个屏幕值到另一个?屏幕

由网友(你是我的心跳)分享简介:我需要从一个屏幕传递数据的(字符串)到另一个屏幕。在按钮的时候点击我需要传递的第一个画面值到下一个画面。I need to pass data's (String) from one screen to another screen. At the time of button click i need to pas...

我需要从一个屏幕传递数据的(字符串)到另一个屏幕。在按钮的时候点击我需要传递的第一个画面值到下一个画面。

I need to pass data's (String) from one screen to another screen. At the time of button click i need to pass values from first screen to the next screen.

推荐答案

您可以沿着传递数据,在启动第二个活动的意图演员:

You can pass along data as extras in the intent that starts the second activity:

Intent myIntent = new Intent(view.getContext(), NextActivity.class); 
myIntent.putExtra("extra", id);
startActivityForResult(myIntent, 0);   

在您的个人资料的活动的onCreate方法,您可以访问其它功能:

In the oncreate method of your profile activity you can access the extras:

int id = getIntent().getStringExtra("extra");       

如果你是新的机器人,它可以帮助通读的开发文档的例子,像的记事本教程。

If you are new to Android, it might help to read through the examples in the developer docs, like the notepad tutorial.

阅读全文

相关推荐

最新文章