spinner

Android - set focus on EditText after Spinner selection

喜欢而已 提交于 2019-12-07 02:26:56
问题 I have the following items displayed on the screen: EditText Forename Spinner gender selection (Male | Female) EditText Email When the application is first launched, I want the focus to be set on the Forename EditText. Then after "Male" or "Female" has been selected in the Spinner, I want the focus to be set on the Email EditText that is located below the spinner. I have used setOnItemSelectedListener to set the requestFocus on the email EditText, but the problem is that it automatically sets

Using SimpleAdapter with Spinner

前提是你 提交于 2019-12-07 00:13:37
问题 I am new to Android development. I am trying to populate a spinner by using the SimpleAdapter. But spinner's list is showing blank element. When I click any element, its text is shown properly in Toast. Please tell me what is the problem in my code below. public void onCreate(Bundle savedInstanceState) { private List<Map<String, String>> data = new ArrayList<Map<String, String>>(); String[] from = new String[] { "colorsData" }; int[] to = new int[] { R.id.spinner }; String[] colors =

Customizing spinner font [closed]

一个人想着一个人 提交于 2019-12-07 00:02:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am having a spinner with a simple list in it. I want to know whether I could replace the style of the font in my spinner. Or is there anyway that I could make use to change the font style,size and color. Any

I can't see the progress spinner in ProgressDialog on Lollipop

不想你离开。 提交于 2019-12-06 23:33:39
问题 Making an app using ProgressDialog, and it shows up fine on JellyBean but when testing with Lollipop I only see the title and message, no progress spinner.. I am using compile 'com.android.support:appcompat-v7:22.2.0' Support library and AppCompatActivity The code is: ProgressDialog progressDialog = new ProgressDialog(AddBuddyActivity.this); progressDialog.setMessage("Loading..."); progressDialog.setCancelable(false); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);

自定义在两种屏幕尺寸中使用spinner

拟墨画扇 提交于 2019-12-06 16:53:36
spinner就是可以点击的TextView,完全可以使用TextView,使用适当的背景,做出下拉框,其实更方便,如果使用spinner这个组件,可以分别定义,写了个Demo,spinner不好看,可以换背景图片,代码如下: 1.首先AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.testspinnertext" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true"/> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity

Using Button to Get A Value From onOptionsItem Selected

谁说胖子不能爱 提交于 2019-12-06 16:24:03
I'm making an app that can show Fruit Options on screen. The fruits are: Apple Grape Orange On screen process, i put switching process, so it will switch: Apple first for 2 secs Then switch to Grape for 2 secs Then Switch Orange for 2 secs The switching process will work continuously. Now i want to make a "Choose Button" and a "Spinner" so the user can choose a fruit the will see his choice on "spinner". For Example: A user wants to choose an orange. The user will wait till the "Orange" is shown on screen. When "Orange" is being shown on the screen, directly he will press "Choose Button" then

How to create a Spinner widget inside of a PopupWindow in Android? Get BadTokenException when clicking on Spinner

南楼画角 提交于 2019-12-06 16:06:00
I've been searching the web for the solution to this problem, but, unfortunately, I can't seem to find the answer. I created an XML file for a PopupWindow with a Spinner inside of it. Inside a button event listener, I call the following code to inflate the PopupWindow and display it on the screen. LayoutInflater inflater = getLayoutInflater(); settings_layout = inflater.inflate(R.layout.setting_popout, (ViewGroup) findViewById(R.id.setting_popout)); // Creates a popup window of required width and height, and displays // the popup in the center of the screen. pw_settings = new PopupWindow

Sorting Custom Listview Items Using Spinner Android

本小妞迷上赌 提交于 2019-12-06 15:45:23
I am attempting to sort the items in a listview both alphabetically and numerically upon selection of the sorting style using a spinner. Essentially whenever the user selects a spinner item the listview will be sorted according the option they chose. Since this is a custom listview with a custom adapter I have been having some issues finding a way to actually sort it properly. If anyone can give me some advice on how I can go about this it would be greatly appreciated. Below is what I have right now for the main class that deals with displaying the listview: protected void onCreate(Bundle

wait_fences: failed to receive reply: 10004003 error - UIAlertView with UIActivityIndicatorView

荒凉一梦 提交于 2019-12-06 15:04:35
I hoped that the answers to squeezemylime's question would solve my problem as I also have a UIAlertView without text field but it did not work out well. Instead of a text field I placed a UIActivityIndicatorView animating on it and no buttons used on creation. So the alert gets programmatically dismissed so that the delegate method destroys the spinner on the alert and the alert itself (which has been retained through the time running). So, I'm getting also these wait_fences: messages within the debugger and I'm frozen in the meantime because everything I tried including the valuable hints in

android: each item of spinner different color

廉价感情. 提交于 2019-12-06 13:58:52
I have a spinner in which I would like to have the text of each item be a different color. for example on item0 the text should be red, item1 the text should be blue, and item2 the text should be green. I tried setting the item I want to change to a textView and changing the color of the textview but it does not work that way. any ideas on how to acomplish this task? Spinner spinner = (Spinner) findViewById(R.id.spinner1); ArrayList<String> array = new ArrayList<String>(); array.add("item0"); array.add("item1"); array.add("item2"); ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter