You can add text changed listener to your edit text and if user entered the name enable the button.
yourEditText.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
// enable your button here.
}
public void beforeTextChanged(CharSequence s, int start, int count, int after)
{}
public void onTextChanged(CharSequence s, int start, int before, int count)
{}
});
For passing this value into another activity you can add bundle to your intent:
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
Bundle b = new Bundle();
b.putString("playerName", name); // Player name
intent.putExtras(b);
startActivity(intent);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…