There is a class:
public class MyDatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener //Создадим объект календарь @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Log.d(Constants.LOG_TAG, "MyDatePickerFragment - onCreateDialog - Создадим объект календарь"); // определяем текущую дату Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); // создаем DatePickerDialog и возвращаем его Dialog picker = new DatePickerDialog(getActivity(), this, year, month, day); picker.setTitle(R.string.choose_date); return picker; } @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { } I do a call like this:
public void changeDate (View view){ Log.d(Constants.LOG_TAG, "ChangeTask - changeDate - Метод изменения даты"); //вызываем диалог и заносим результат в текстВью MyDatePickerFragment dateDialog = new MyDatePickerFragment(); dateDialog.show(getFragmentManager(), "ChangeTask"); }
As I understand the second parameter in the show method is the TAG - identifier. There is a need to call the same dialogue in another Activity .
How to check where the call came from?
As I understand it somehow you need to pull out the TAG in the onDateSet method, but how?