I want to allow the App users to change the Button text in Android. When User clicks Button, it should do something but when he/she LongClicks the button, an edittext should pop-up & whatever user types into it should get saved as Button Text. So far I have completed following thing.
btn1 = (Button) findViewById(R.id.button1);
etLabel = (EditText) findViewById(R.id.etName);
btn1.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
// How to pop-up edittext from here
// to allow user change Button name
btn1.setText(name);
return true;
}
});
}
public void onButtonClick(View view) {
switch (view.getId()) {
case R.id.button1:
// do something else here
break;
}
}