[英]Is it Possible to Pass Edittext Value from one activity to another activity without using Intent
Intent intent = new Intent(this, Page.class);
intent.putExtra("arg", getText);
startActivity(intent);
//second activity:
String passedArg = getIntent().getExtras().getString("arg");
enteredValue.setText(passedArg);
To get value from one activity to another activity without using intents....??在不使用意图的情况下从一项活动获得另一项活动的价值....?? I want to show edittext passed data in other activity edittext but without using intent...??我想在其他活动edittext中显示edittext传递的数据但不使用意图......? Kindly help me is it possible or not....??请帮助我是否可能....??
There are many ways: event buses, SharedPreferences, through global object (application class), database, simple file.有很多方法:事件总线、SharedPreferences、通过全局对象(应用程序类)、数据库、简单文件。 But why?但为什么?
Try direct and readable style first.首先尝试直接和可读的风格。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.