I need an Array with username and password. The method containing the array needs to return it. I tried the following code but android studio is showing and error when I tried to access the array from another method:
public class MainActivity extends Activity {
private static Boolean log_status;
public String[] credentials () {
String Username;
String Password;
String login_data;
EditText editText = (EditText) findViewById(R.id.username);
EditText editPass = (EditText) findViewById(R.id.password);
Username = editText.getText().toString();
Password = editPass.getText().toString();
String[] log_data= new String[1];
log_data[0]= Username;
log_data[1]=Password;
return log_data;
}
How can I make the log_data array be accessed by another method? Does my code return an array?