KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am asking the user for input via a Dialog: package com.android.cancertrials; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class CustomDialog extends Dialog { private String name; // private ReadyListener readyListener; public static EditText etName; public String zip; public CustomDialog(Context context, String name) { super(context); this.name = name; // this.readyListener = readyListener; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mycustomdialog); setTitle("Enter the Zip Code "); Button buttonOK = (Button) findViewById(R.id.ok); buttonOK.setOnClickListener(new OKListener()); etName = (EditText) findViewById(R.id.EditZip); } private class OKListener implements android.view.View.OnClickListener { @Override public void onClick(View v) { // readyListener.ready(String.valueOf(etName.getText())); CustomDialog.this.dismiss(); } } } When the user hits OK, how can I pass the value that was entered in the textbox, back to a member variable in the Activity that launched it?
Tags (comma-separated)
Save Edits
Cancel