TimePickerListener calling two methods for same time
<p>Hi please find the below code I am facing issue with Time dialog listener method, It's calling two times listener.How to fix the listener one time.</p>

<pre><code>@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case TIME_DIALOG_ID:
        // set time picker as current time
        return new TimePickerDialog(this, timePickerListener, hour, minute,
                false);

    }
    return null;
}

private TimePickerDialog.OnTimeSetListener timePickerListener = new TimePickerDialog.OnTimeSetListener() {
    public void onTimeSet(TimePicker view, int selectedHour,
            int selectedMinute) {

        System.out.println("=========Dialog==================");

        hour = selectedHour;
        minute = selectedMinute;

        // set current time into textview
        tvDisplayTime.setText(new StringBuilder().append(pad(hour))
                .append(":").append(pad(minute)));

        // set current time into timepicker
        timePicker1.setCurrentHour(hour);
        timePicker1.setCurrentMinute(minute);

    }
};

private static String pad(int c) {
    if (c &gt;= 10)
        return String.valueOf(c);
    else
        return "0" + String.valueOf(c);
}
</code></pre>

<p>Please help me for call listener one time, I am refering this URL:
<a href="http://www.mkyong.com/android/android-date-picker-example/" rel="nofollow">http://www.mkyong.com/android/android-date-picker-example/</a></p>

<p>I am using emulator version 4.1 .</p>
