Given your problem, how to transfer data between actions, and you can do this through your alertdialog. To transfer data from one activity to another, you can do this through intent as
Intent intent = new Intent(context, ActivitytoStart.class); intent.putExtra(key, value); startActivity(intent);
In other activities, you can get this data through:
getIntent().getExtras().get(key);
for your edittext to return data you can use
startActivityForResult(intent, 0);
and set the value in another activity as follows:
private void setData(){ Bundle conData = new Bundle(); conData.putString(key, value); Intent intent = new Intent(); intent.putExtras(conData); setResult(RESULT_OK, intent); }
and receive this data in their activity:
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(resultCode == RESULT_OK){
source share