in my activity when the user clicks a textview a custom dialog box is opened. Here i have set some wheel pickers. The value which the user sets in the wheel picker is been shown as a title in the custom dialog box. When the user clicks the Ok button the dialog box closes and i want the that title text to be displayed in my main activity's text view.
I know that we can set initialize a variable in our activity class and set it's value in dialog box, nothing special. But i have written the Custom dialog box as a separate class file as follows
bd = (TextView)findViewById(R.id.editText1);
bd.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
CustomizeDialog customizeDialog = new CustomizeDialog(main.this);
customizeDialog.show();
}
});
How to get the value from that class to my main activity class...
I found a better way, in my main activity i have assigned the TextView as
public static TextView bd;
In my CustomizeDialog class when i initialized a variable as follow
static String bdDate;
When i click the Ok button to close the the Custom Dialog, i have written as
close.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
if (v == close)
bdDate = wheelMenu3[getWheel(R.id.p3).getCurrentItem()];
main.bd.setText(bdDate);
dismiss();
}
});