« first day    last day (17 days later) » 

1:05 AM
Thank you for looking at it. However, I did put it in ` void setDefaultValues() {
NumberPicker hourPicker, minPicker;

hourPicker = (NumberPicker) getDialog().findViewById(R.id.hour_picker);
hourPicker.setMinValue(0);
hourPicker.setMaxValue(23); ....}`
should it have been put somewhere else?
 
 
1 hour later…
2:27 AM
@Libin where can I call it from? in the constructor it causes a null pointer exception `04-23 21:25:43.256: E/AndroidRuntime(32620): Caused by: java.lang.NullPointerException
04-23 21:25:43.256: E/AndroidRuntime(32620): at com.mypreferences.TimePeriodPreference.setDefaultValues(TimePeriodPreference.java:37)
04-23 21:25:43.256: E/AndroidRuntime(32620): at com.mypreferences.TimePeriodPreference.<init>(TimePeriodPreference.java:20)
`
 
 
9 hours later…
11:29 AM
Do it after setDialogLayoutResource.
 
 
2 hours later…
1:18 PM
` public TimePeriodPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setDialogLayoutResource(R.layout.time_preference);
setPositiveButtonText(android.R.string.ok);
setNegativeButtonText(android.R.string.cancel);
setDialogIcon(null);
setPersistent(false);
setDefaultValues();
}`
I had put it here at the end and got the null pointer - stack trace listed above
 
1:54 PM
Also, findViewById() is undefined there but if one uses getDialog(), you get a nullpointer hourPicker = (NumberPicker) getDialog().findViewById(R.id.hour_picker);
 
 
5 hours later…
6:59 PM
Oh, Don't use the getDialog() . You need to pass the dialogView from onCreateDialogView to your setDefaultValues(dialogView)
 
7:32 PM
No. Close to Kerala border. Tamil
 
7:59 PM
@Libin, my wife was sure you are malayali. But thank you and may Jesus bless you richly for helping me!
I lost my job and am trying to write an android app so that it will help me get a new job. I live in the chicago area.
 
oh. Sure, You will get a job soon.
 
8:16 PM
@Libin I will post here, a link to my app when it is done, so you can see some of your help in it. :)
 
sure
 

« first day    last day (17 days later) »