Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue on multiple date picker
    primarykey
    data
    text
    <p>I'd like to set a date interval, and when the user presses the end date, draw a chart. The problem i have is that the chart is drawn both on the start and the end date.</p> <p>I've tried to set a boolean variable or an int to decide when the chart should be drawn, but as i'm using "onDateSet" from "DatePickerFragmet", i cannot modify its parameters... I paste my code here to help clarify what i'm trying to explain:</p> <p>On my main activity i have:</p> <pre><code>startDate.setOnClickListener(new OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub for (int i=0; i&lt;2; i++){ showDatePickerDialog(v,i); } } }); public void showDatePickerDialog(View v, int i) { DialogFragment newFragment = new DatePickerFragment(); newFragment.show(getFragmentManager(), "datePicker"); } </code></pre> <p>Then on a new class i call onDateSet:</p> <pre><code>public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the current date as the default date in the picker final Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); // Create a new instance of DatePickerDialog and return it return new DatePickerDialog(getActivity(), this, year, month, day); } public void onDateSet(DatePicker view, int year, int month, int day) { // Do something with the date chosen by the user LineGraph lineGraph = new LineGraph(); lineGraph.run(getActivity()); } </code></pre> <p>... How could i draw the chart when the final date is selected?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload