I have two layouts (name is regis and log)
I can’t get Text from EditText in regis.xml to log.xml when I use code
setContentView(R.layout.log);
…
final EditText user = (EditText) findViewById(R.id.edt1);
String usr = user.getText().toString();
Because ‘edt1’ is element other layout (edt1 is id EditText regis.xml)
How to get edt1 into log.xml ?
Example please
thanks you very much
You can use the LayoutInflater class. Create a LayoutInflater, and then inflate the layout file containing the view you would like to access (in this case the EditText).