ShatterStar
Newbie
Hi,
I am creating a DatePicker in a dialog, below is the code that I have in my DateDialog.jaja file
In my Activity1.java file I have a method to show the dialog like this
Now from what I have read there is a DatePickerDialog.OnDateSetListener, how / where would I apply this method?
I am creating a DatePicker in a dialog, below is the code that I have in my DateDialog.jaja file
Code:
package com.example.myapp;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.app.DatePickerDialog;
import android.widget.DatePicker;
public class DateDialog extends DialogFragment {
private View dialogView;
[USER=1021285]@override[/USER]
public Dialog onCreateDialog(Bundle savedInstanceState){
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
dialogView = inflater.inflate(R.layout.date_dialog, null);
builder.setView(dialogView);
return builder.create();
}
private DatePickerDialog.OnDateSetListener dateSetListener = new DatePickerDialog.OnDateSetListener(DatePicker d, int c, int p){
}
}
In my Activity1.java file I have a method to show the dialog like this
Code:
private void displayDialog(View v){
DateDialog dateDialog = new DateDialog();
dateDialog.show(getFragmentManager(), "123");
}
Now from what I have read there is a DatePickerDialog.OnDateSetListener, how / where would I apply this method?
Last edited by a moderator: