numberpicker

How to solve android.view.InflateException when using com.android.internal.widget.NumberPicker?

假如想象 提交于 2019-12-25 05:22:24
问题 I'm using this blog to create a custom Number Picker. I've added this source project to my Eclipse but when I run this project in emulator I get this error in LogCat. 10-14 15:31:46.074: E/AndroidRuntime(878): java.lang.RuntimeException: Unable to start activity ComponentInfo{maximyudin.NumberPickerDemo/maximyudin.NumberPickerDemo.NumberPickerDemo}: android.view.InflateException: Binary XML file line #5: Error inflating class com.android.internal.widget.NumberPicker Here is my AndroidManifest

Android NumberPicker set number of items to wrap items around

送分小仙女□ 提交于 2019-12-24 14:11:09
问题 I was trying to set the hour and minute in the TimePicker and I found that it seems that there is a minimum number of items required in the NumberPicker for the values to wrap around. How do i set the number of items to lesser than the default if i don't have so many values (got only 4: "00", "15", "30" and "45")? The image below shows the hours as correct but the minutes as wrong. I need the minutes to wrap around (i.e. "45" before "00") like the hours. Here is my code: @SuppressLint("NewApi

How to display more than 3 values at a time in a NumberPicker

£可爱£侵袭症+ 提交于 2019-12-24 02:23:22
问题 I'm creating a number picker as indicated in the attached image below but I want to show more than 3 values if space is available. This picker has 20 items and there is plenty of room to show more than 3 values. Can this be accomplished using NumberPicker? 回答1: just set Programatically numberPicker.setWheelItemCount(10); 来源: https://stackoverflow.com/questions/15776716/how-to-display-more-than-3-values-at-a-time-in-a-numberpicker

How to get the selected number from NumberPicker? [closed]

核能气质少年 提交于 2019-12-23 09:56:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have two number pickers, I want to get the value that user chose from thos number pickers. then convert them to String. Any idea? 回答1: You can get current picked number by calling getValue(), eg. if you have myPicker, you can do this: String value = "" + myPicker.getValue(); If you want to get the value when

Number picker in custom listview changing number by itself

瘦欲@ 提交于 2019-12-23 07:10:02
问题 I am working on app in which I am using a Custom ArrayAdaptor to populate my listView.The customoized row includes a number Picker along with some text boxes in its activity. Now the Problem Part--> The funny part is that when i am changing the number of number picker in a particular row other number pickers of other rows get changed automatically.I have been staring at my code almost 2 days now .Please help Custom_row.java public class Custom_row extends ArrayAdapter { static Button ProPay;

Change android numberpicker divider color

╄→尐↘猪︶ㄣ 提交于 2019-12-22 18:16:26
问题 I want to change the divider color(blue) of numberpicker shown above to transparent. I tried a lot of things like number_picker.setDividerDrawable(getResources().getDrawable(R.color.transparent)); number_picker.setShowDividers(NumberPicker.SHOW_DIVIDER_NONE); I also tried settings android:divider in xml But none of them worked Then I tried setting it using styles, but when I put the following entry in my styles, it says minimum version required is 14 and my app has minimum version 11 <style

Custom Date Time picker using NumberPicker and FragmentDialog in android

爱⌒轻易说出口 提交于 2019-12-22 01:39:24
问题 I want to a custom Date Time Picker Dialog exactly as shown in the image. In my project this is dialog is shown when clicked on a TextView which is in a Fragment . I know that I need to use NumberPickers which populates the dates From Current date till all the dates next week. The default android date and time pickers doesnt fit my required so I need to create my own custom `DateTimePicker fragmentDialog'. My required DateTimePicker <LinearLayout android:background="@color/background_default

AlertDialog with NumberPicker rendered incorrectly

点点圈 提交于 2019-12-21 05:16:24
问题 I' have a problem about 'rendering' with my NumberPicker inside an AlertDialog. I show to you the code: //setup del dialog AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setCancelable(false); final NumberPicker picker = new NumberPicker(activity); picker.setMinValue(0); picker.setMaxValue(5); //set bottoni dialog builder.setPositiveButton(R.string.dialog_btn_seleziona, seleziona); builder.setNegativeButton(R.string.dialog_btn_annulla, null); //visualizzo il dialog

NumberPicker showing wrong value after setValue()

岁酱吖の 提交于 2019-12-20 03:14:15
问题 I was trying to create a NumberPicker that would meet my needs, but I stumbled upon something and I don't understand what it is. The behavior is simple, I have three number pickers and each one of them can have a value from -15 to 15; when the user presses the Ok button the values selected, if valid, are saved in a "structure" and in a SharedPreferences for convenience. The problem is shown in this screenshot. When I save a number that is not -1 it works without problems. If I save a -1 the

Create NumberPicker dialog in preference

霸气de小男生 提交于 2019-12-19 02:18:43
问题 I am trying to create a NumberPicker dialog in my preference screen. I have already made one following this:https://stackoverflow.com/a/5533295/2442638 However, for my second dialog, I only want one spinner, so I have adapted the code as follows: import android.content.Context; import android.content.SharedPreferences; import android.content.res.TypedArray; import android.preference.DialogPreference; import android.util.AttributeSet; import android.view.View; import android.widget