[android-developers] Spinner control displays unwanted keyboard
I have an activity in which there are several buttons and a spinner containing a list of preset values. Unfortunately, if the user accidentally or mistakenly taps the spinner, the soft keyboard appears. Why? There is nowhere on the screen that expects typed input from the user. More to the point, how can I prevent this from happening? After some research, I tried adding the following code: m_TricksPicker.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { InputMethodManager imm=(InputMethodManager)getApplicationContext(). getSystemService(getApplicationContext().INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getParent().getCurrentFocus().getWindowToken(), 0); return false; }}) ; Unfortunately, this throws a null pointer exception. Any other suggestions how to stop the keyboard from appearing (and I'd really like to understand why the system thinks it's necessary in the first place, when no user input is required)? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/e229b1bb-03bc-4ffd-8f2b-09bb86e8610a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Spinner in tabwidget
On Fri, Feb 21, 2014 at 1:54 AM, Rahul Kaushik rahulkaushi...@gmail.comwrote: i have tabs each containg 50 +edit text and this may very up to 1000 so saving the data will make the app too bulky,so More bulky than 50+ edit texts? OK. i added view(Containing spinner and buttons) in tabwidget and set the default tabs of width 1dp, now am able to switch between tabs data with the spinner item click without losing data but now issue is when i click on spinner item scrolling is not working Please suggest It's hard to suggest since your description is, again, so vague. I suggest you debug your app and implement a solution. Or better describe the problem. Or show a picture of the issue. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Spinner in tabwidget
On Thu, Feb 20, 2014 at 12:58 AM, Rahul Kaushik rahulkaushi...@gmail.comwrote: issue with current approach, i have to recreate the Data Layout and because of this i can not persist the entered values in controls .like when i go back to earlier clicked option from tab data enter in the controls are lost So just save the data for each tab when you transition from it. You must have some kind of data object model that represents your data and is stored in memory ... right? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Spinner in tabwidget
i have tabs each containg 50 +edit text and this may very up to 1000 so saving the data will make the app too bulky,so i added view(Containing spinner and buttons) in tabwidget and set the default tabs of width 1dp, now am able to switch between tabs data with the spinner item click without losing data but now issue is when i click on spinner item scrolling is not working Please suggest Thanks RK On Fri, Feb 21, 2014 at 4:55 AM, TreKing treking...@gmail.com wrote: On Thu, Feb 20, 2014 at 12:58 AM, Rahul Kaushik rahulkaushi...@gmail.comwrote: issue with current approach, i have to recreate the Data Layout and because of this i can not persist the entered values in controls .like when i go back to earlier clicked option from tab data enter in the controls are lost So just save the data for each tab when you transition from it. You must have some kind of data object model that represents your data and is stored in memory ... right? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Spinner in tabwidget
Hello I want to create a tab widget in which have a previous button ,a spinner then again a next button When user expand the spinner and click on any options it should work like regular button in tab widget and click on next button it should show me the next tab data and when i click on prevois button it should show me the prevoius button data PLease Suggest Thanks RK -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Spinner in tabwidget
On Thu, Feb 20, 2014 at 12:19 AM, Rahul Kaushik rahulkaushi...@gmail.comwrote: I want to create a tab widget in which have a previous button ,a spinner then again a next button When user expand the spinner and click on any options it should work like regular button in tab widget and click on next button it should show me the next tab data and when i click on prevois button it should show me the prevoius button data PLease Suggest 1 - You need to explain the issue better - maybe show a picture of what you're trying to achieve? 2 - What have you tried that hasn't worked? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Spinner borders
Hi, I need to create a small spinner in height. So I created a spinner with 58pixels height, but it has big borders on top and bottom, so it cuts most of the text. It has a top border of 25 pixels and a bottom border of 19 pixels. So from the total 58 pixels, only 14 are used to show the text. How can I change this? How can I decrease the top and bottom borders or increase the text area? I have tryed to change the background drawable with 9 patch png, but it does not affect the area used for the text. I need to do it programatically. Thanks Filipe Madureira -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Spinner borders
Hi, I need to create a small spinner in height. So I created a spinner with 58pixels height, but it has big borders on top and bottom, so it cuts most of the text. It has a top border of 25 pixels and a bottom border of 19 pixels. So from the total 58 pixels, only 14 are used to show the text. How can I change this? How can I decrease the top and bottom borders or increase the text area? I have tryed to change the background drawable with 9 patch png, but it does not affect the area used for the text. I need to do it programatically. Thanks Filipe Madureira -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Spinner com BD
Bom dia Pessoal Gostaria de saber como eu faço para pegar dados do banco e mostrar no componente Spinner. Fiz desta maneira porém nada está trazendo: String items; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.lancamento); items = getResources().getString(R.layout.categoria); Spinner spnCategoria = (Spinner) findViewById(R.id.spnCategoria); ArrayAdapterCharSequence adapter = ArrayAdapter.createFromResource( this, R.layout.categoria, android.R.layout.simple_selectable_list_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spnCategoria.setAdapter(adapter); Desde já agradeço pela atenção. att, Andreia -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] spinner
Hi friends, i need a help,can some oe tell me that how to dynamically add a value in spinner in android. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] spinner
Hi sadhna, It is very easy , You have to add the value in array adapter only. Thanks Mani On Fri, Mar 8, 2013 at 2:31 PM, Sadhna Upadhyay sadhna.braah...@gmail.comwrote: Hi friends, i need a help,can some oe tell me that how to dynamically add a value in spinner in android. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Spinner
Hi guys, If i pressed the spinner i ll get the popup menu.if my list contain only one item means then the spinner does not show the popupmenuhow can i do tat one -- *Thanks Regards* *K.Arun Kumar* -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] spinner list
i have spinner list ,having 4 option i want to select one of them and it should act like button -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Spinner does not apply dropDownSelector attribute
Hi there, I'm using spinner and want to add spinner - to change behavior depends of states(focused, pressed) My code: *activity_main.xml* Spinner android:id=@+id/spinner android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentTop=true android:layout_centerHorizontal=true android:layout_marginTop=30dp android:spinnerMode=dropdown android:dropDownSelector=@drawable/spinner_state / *spinner_state.xml* ?xml version=1.0 encoding=utf-8? selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_enabled=false android:drawable=@color/black / item android:state_pressed=true android:state_enabled=true android:drawable=@color/red / item android:state_focused=true android:state_enabled=true android:drawable=@color/red / item android:state_enabled=true android:drawable=@color/gray / /selector *AndroidManifest:* uses-sdk android:minSdkVersion=8 android:targetSdkVersion=16 / So, if I run app in emulator Android 4.0.2 API 14 and try to select some item or scroll using wheel of my mouse no any effect, that I set in selector(when press or scrolling - items should be red, but it is blue - default for ICS color). For Android 2.2 API 8 when press or scroll using wheel(in this case state is focused) color is yellow[orange](default color for Android 2.2) How to enable selector for spinner? sample project here https://github.com/vovs/spinner_issue http://i.stack.imgur.com/7ZGFW.png -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Spinner List background
Is there any way to change the background of Spinner List?? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner List background
On Mon, Nov 19, 2012 at 6:53 AM, Nimish John nimishj...@gmail.com wrote: Is there any way to change the background of Spinner List?? If you mean the individual items, then just override the getView method of the adapter that is feeding the Spinner. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] spinner
Hello friends , I want to show Select option in spinner when application launch,and when i select any item that should be on the spinner how we can do this. Thanks in advance -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner original text
How can make a Spinner show a particular text before the user chooses an item from the list? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner original text
Sample Project you can use this concept with a help of Boolean value u can archive the concept. public class SpinnerSampleActivity extends Activity { private String TAG = SpinnerHint; private Spinner typeSpinner; private static ArrayListString data = new ArrayListString(); private LayoutInflater mInflator; private boolean selected; private static int no = 3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); selected = false; typeSpinner = (Spinner) findViewById(R.id.id_type_spinner); typeSpinner.setAdapter(typeSpinnerAdapter); typeSpinner.setOnItemSelectedListener(typeSelectedListener); typeSpinner.setOnTouchListener(typeSpinnerTouchListener); mInflator = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); Log.d(TAG, UI Initialized); findViewById(R.id.btn).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Log.e(size, +data.size()); data.add( + no++); ((BaseAdapter) typeSpinnerAdapter).notifyDataSetChanged(); } }); } private SpinnerAdapter typeSpinnerAdapter = new BaseAdapter() { private TextView text; @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = mInflator.inflate(R.layout.row, null); } text = (TextView) convertView.findViewById(R.id.spinnerTarget); if (!selected) { text.setText(Please select a value); } else { text.setText(data.get(position)); } return convertView; } @Override public long getItemId(int position) { return position; } @Override public Object getItem(int position) { return data.get(position); } @Override public int getCount() { return data.size(); } public View getDropDownView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = mInflator.inflate( android.R.layout.simple_spinner_dropdown_item, null); } text = (TextView) convertView.findViewById(android.R.id.text1); text.setText(data.get(position)); text.setMaxLines(2); return convertView; }; }; private OnItemSelectedListener typeSelectedListener = new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? parent, View view, int position, long id) { Log.d(TAG, user selected : + typeSpinner.getSelectedItem().toString()); } @Override public void onNothingSelected(AdapterView? parent) { } }; private OnTouchListener typeSpinnerTouchListener = new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { selected = true; ((BaseAdapter) typeSpinnerAdapter).notifyDataSetChanged(); return false; } }; } On Tue, Oct 9, 2012 at 4:13 PM, Ankush Aggarwal ankush.agga...@gmail.comwrote: How can make a Spinner show a particular text before the user chooses an item from the list? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Regards, Perumal.N -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner Styling - Am I Nuts??
Hey guys! I have a spinner backed up by an ArrayAdapter in my layout. I'd like to change the look of the spinner button to match the buttons that are next to it. Here is my Spinner xml: Spinner android:id=@+id/location_type_spinner style=@android:style/Widget.Button android:layout_width=0dp android:layout_height=fill_parent android:layout_weight=.33 android:background=@drawable/control_bar_background android:gravity=center android:textColor=#FF00 android:textSize=12dp / While the bounds of the button (it fills the width/height/weight correctly) and the background work, the text is larger and the gravity is not centered. I'm going nuts trying to fix this! What am I missing? Is there a different style I need to use or something like that? Thanks! E -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Styling - Am I Nuts??
The contents of a spinner is provided by its adapter. Check the layout used by your adapter's getView(). -- K 2012/7/26 Evan Ruff evan.r...@gmail.com Hey guys! I have a spinner backed up by an ArrayAdapter in my layout. I'd like to change the look of the spinner button to match the buttons that are next to it. Here is my Spinner xml: Spinner android:id=@+id/location_type_spinner style=@android:style/Widget.Button android:layout_width=0dp android:layout_height=fill_parent android:layout_weight=.33 android:background=@drawable/control_bar_background android:gravity=center android:textColor=#FF00 android:textSize=12dp / While the bounds of the button (it fills the width/height/weight correctly) and the background work, the text is larger and the gravity is not centered. I'm going nuts trying to fix this! What am I missing? Is there a different style I need to use or something like that? Thanks! E -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Styling - Am I Nuts??
Kostya, Thanks for the response. Just to clarify, the getView in the adapter sets the BUTTON? I thought that set the view for the actual menu of items? Thanks, E On Thursday, July 26, 2012 8:38:36 AM UTC-4, Kostya Vasilyev wrote: The contents of a spinner is provided by its adapter. Check the layout used by your adapter's getView(). -- K 2012/7/26 Evan Ruff evan.r...@gmail.com Hey guys! I have a spinner backed up by an ArrayAdapter in my layout. I'd like to change the look of the spinner button to match the buttons that are next to it. Here is my Spinner xml: Spinner android:id=@+id/location_type_spinner style=@android:style/Widget.Button android:layout_width=0dp android:layout_height=fill_parent android:layout_weight=.33 android:background=@drawable/control_bar_background android:gravity=center android:textColor=#FF00 android:textSize=12dp / While the bounds of the button (it fills the width/height/weight correctly) and the background work, the text is larger and the gravity is not centered. I'm going nuts trying to fix this! What am I missing? Is there a different style I need to use or something like that? Thanks! E -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Styling - Am I Nuts??
The button? There is no button. If you're on Android 2.*, the little arrow on the right side (which is used to show the item list) is part of the spinner's background... except I see you've specified your own. The text you see inside the spinner is part of the view provided by the spinner's adapter. The centering, and text size, or its color, if any, would need to be provided by the adapter's getView(). -- K 2012/7/26 Evan Ruff evan.r...@gmail.com Kostya, Thanks for the response. Just to clarify, the getView in the adapter sets the BUTTON? I thought that set the view for the actual menu of items? Thanks, E On Thursday, July 26, 2012 8:38:36 AM UTC-4, Kostya Vasilyev wrote: The contents of a spinner is provided by its adapter. Check the layout used by your adapter's getView(). -- K 2012/7/26 Evan Ruff evan.r...@gmail.com Hey guys! I have a spinner backed up by an ArrayAdapter in my layout. I'd like to change the look of the spinner button to match the buttons that are next to it. Here is my Spinner xml: Spinner android:id=@+id/location_**type_spinner style=@android:style/Widget.**Button android:layout_width=0dp android:layout_height=fill_**parent android:layout_weight=.33 android:background=@drawable/**control_bar_background android:gravity=center android:textColor=#FF00 android:textSize=12dp / While the bounds of the button (it fills the width/height/weight correctly) and the background work, the text is larger and the gravity is not centered. I'm going nuts trying to fix this! What am I missing? Is there a different style I need to use or something like that? Thanks! E -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@** googlegroups.com android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Styling - Am I Nuts??
On Thu, Jul 26, 2012 at 8:44 AM, Evan Ruff evan.r...@gmail.com wrote: Thanks for the response. Just to clarify, the getView in the adapter sets the BUTTON? I thought that set the view for the actual menu of items? The SpinnerAdapter supplies both the View for the Spinner in the closed state and the Views for the rows in the pop-up list that appears when the Spinner is in the open state. That is why you need to supply two layout resources. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.8 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Styling - Am I Nuts??
2012/7/26 Mark Murphy mmur...@commonsware.com On Thu, Jul 26, 2012 at 8:44 AM, Evan Ruff evan.r...@gmail.com wrote: Thanks for the response. Just to clarify, the getView in the adapter sets the BUTTON? I thought that set the view for the actual menu of items? The SpinnerAdapter supplies both the View for the Spinner in the closed state and the Views for the rows in the pop-up list that appears when the Spinner is in the open state. That is why you need to supply two layout resources. And to further clarify - it's getView() and getDropDownView() respectively. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.8 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Styling - Am I Nuts??
AND BOOM. That's where I was getting all turned around. Thanks Mark and Kostya! E On Thursday, July 26, 2012 8:56:06 AM UTC-4, Kostya Vasilyev wrote: 2012/7/26 Mark Murphy mmur...@commonsware.com On Thu, Jul 26, 2012 at 8:44 AM, Evan Ruff evan.r...@gmail.com wrote: Thanks for the response. Just to clarify, the getView in the adapter sets the BUTTON? I thought that set the view for the actual menu of items? The SpinnerAdapter supplies both the View for the Spinner in the closed state and the Views for the rows in the pop-up list that appears when the Spinner is in the open state. That is why you need to supply two layout resources. And to further clarify - it's getView() and getDropDownView() respectively. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.8 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner in ListView
Hi, I have a List View Containing spinners which are loaded dynamically at run time on a button click, The spinner is contained in a Array Adapter, The problem is when i click on spinner i do not get the current position/index of that particular spinner in the list view. Please let me know the solution ASAP. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner in ListView
Please let me know the solution ASAP. Please show us your code first... Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Jun 28, 2012 at 11:53 PM, smarajeet smarajeet...@gmail.com wrote: Hi, I have a List View Containing spinners which are loaded dynamically at run time on a button click, The spinner is contained in a Array Adapter, The problem is when i click on spinner i do not get the current position/index of that particular spinner in the list view. Please let me know the solution ASAP. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner show on click of button
Hi friends, How to open spinner on click of a button. I tried Spinner spinner =new Spinner(this); ArrayAdapterString packSizeAdapter = new ArrayAdapterString( activity, R.layout.spinner_item, productUOMS); packSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner .setAdapter(packSizeAdapter); Button btn=new Button(this); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { spinner .performClick(); } }); It is not working at all ,Is there anyting i am missing..Please reply -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner show on click of button
Are you adding your button to your view? Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Jun 21, 2012 at 5:35 AM, vani reddy vani.reddy.bl...@gmail.comwrote: Hi friends, How to open spinner on click of a button. I tried Spinner spinner =new Spinner(this); ArrayAdapterString packSizeAdapter = new ArrayAdapterString( activity, R.layout.spinner_item, productUOMS); packSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner .setAdapter(packSizeAdapter); Button btn=new Button(this); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { spinner .performClick(); } }); It is not working at all ,Is there anyting i am missing..Please reply -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner show on click of button
spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition = spinner.getSelectedItemPosition(); /* * get the category name in which the reason is selected into * the application */ } try it . it wor perfectly On Thu, Jun 21, 2012 at 5:05 PM, vani reddy vani.reddy.bl...@gmail.comwrote: Hi friends, How to open spinner on click of a button. I tried Spinner spinner =new Spinner(this); ArrayAdapterString packSizeAdapter = new ArrayAdapterString( activity, R.layout.spinner_item, productUOMS); packSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner .setAdapter(packSizeAdapter); Button btn=new Button(this); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { spinner .performClick(); } }); It is not working at all ,Is there anyting i am missing..Please reply -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- - Thanks Regards Er.Aashish Kumar Jawla (09555865084/09910783591) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner show on click of button
spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition = spinner.getSelectedItemPosition(); /* * get the category name in which the reason is selected into * the application */ } try it . it wor perfectly This is not what the OP is asking... This will help for getting the selected item once the user has chosen an item. He is asking how to make the spinner show the list of options programatically... Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Jun 21, 2012 at 7:38 AM, Aashish jawla aashishja...@gmail.comwrote: spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition = spinner.getSelectedItemPosition(); /* * get the category name in which the reason is selected into * the application */ } try it . it wor perfectly On Thu, Jun 21, 2012 at 5:05 PM, vani reddy vani.reddy.bl...@gmail.comwrote: Hi friends, How to open spinner on click of a button. I tried Spinner spinner =new Spinner(this); ArrayAdapterString packSizeAdapter = new ArrayAdapterString( activity, R.layout.spinner_item, productUOMS); packSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner .setAdapter(packSizeAdapter); Button btn=new Button(this); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { spinner .performClick(); } }); It is not working at all ,Is there anyting i am missing..Please reply -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- - Thanks Regards Er.Aashish Kumar Jawla (09555865084/09910783591) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner show on click of button
Hi yes I am adding the Button to the view,but i am not adding the spinner to the view On Thu, Jun 21, 2012 at 7:34 PM, Justin Anderson magouyaw...@gmail.comwrote: spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition = spinner.getSelectedItemPosition(); /* * get the category name in which the reason is selected into * the application */ } try it . it wor perfectly This is not what the OP is asking... This will help for getting the selected item once the user has chosen an item. He is asking how to make the spinner show the list of options programatically... Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Jun 21, 2012 at 7:38 AM, Aashish jawla aashishja...@gmail.comwrote: spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition = spinner.getSelectedItemPosition(); /* * get the category name in which the reason is selected into * the application */ } try it . it wor perfectly On Thu, Jun 21, 2012 at 5:05 PM, vani reddy vani.reddy.bl...@gmail.comwrote: Hi friends, How to open spinner on click of a button. I tried Spinner spinner =new Spinner(this); ArrayAdapterString packSizeAdapter = new ArrayAdapterString( activity, R.layout.spinner_item, productUOMS); packSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner .setAdapter(packSizeAdapter); Button btn=new Button(this); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { spinner .performClick(); } }); It is not working at all ,Is there anyting i am missing..Please reply -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- - Thanks Regards Er.Aashish Kumar Jawla (09555865084/09910783591) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner show on click of button
Hi yes I am adding the Button to the view,but i am not adding the spinner to the view Pretty sure the spinner needs to be added to the view for it to work. One option you can do if you don't want to have the spinner UI is to use AlertDialog.Builder... It allows you to set an array of options to display in a list via setSingleChoiceOptions(). You can then display that by calling show() on the dialog when the button is clicked. I've done that many times when I want the functionality of a spinner but want a different UI for it. Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Jun 21, 2012 at 8:14 AM, vani reddy vani.reddy.bl...@gmail.comwrote: Hi yes I am adding the Button to the view,but i am not adding the spinner to the view On Thu, Jun 21, 2012 at 7:34 PM, Justin Anderson magouyaw...@gmail.comwrote: spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition = spinner.getSelectedItemPosition(); /* * get the category name in which the reason is selected into * the application */ } try it . it wor perfectly This is not what the OP is asking... This will help for getting the selected item once the user has chosen an item. He is asking how to make the spinner show the list of options programatically... Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Jun 21, 2012 at 7:38 AM, Aashish jawla aashishja...@gmail.comwrote: spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub int selectedPosition = spinner.getSelectedItemPosition(); /* * get the category name in which the reason is selected into * the application */ } try it . it wor perfectly On Thu, Jun 21, 2012 at 5:05 PM, vani reddy vani.reddy.bl...@gmail.comwrote: Hi friends, How to open spinner on click of a button. I tried Spinner spinner =new Spinner(this); ArrayAdapterString packSizeAdapter = new ArrayAdapterString( activity, R.layout.spinner_item, productUOMS); packSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner .setAdapter(packSizeAdapter); Button btn=new Button(this); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { spinner .performClick(); } }); It is not working at all ,Is there anyting i am missing..Please reply -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- - Thanks Regards Er.Aashish Kumar Jawla (09555865084/09910783591) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] spinner wige
Hey guys im developing an android app using android sdk and i need to apply a spinner widget but its not working that is that spinner is not displaying through my emulator the code solid even tried using sample spinner codes and its the same not displaying help!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] spinner wige
How do you expect us to help you? You haven't given us any pertinent information or code to look at... Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, Jun 18, 2012 at 7:41 PM, Nevin Johnson nevin...@gmail.com wrote: Hey guys im developing an android app using android sdk and i need to apply a spinner widget but its not working that is that spinner is not displaying through my emulator the code solid even tried using sample spinner codes and its the same not displaying help!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Help
Use the following spinner1.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView? parentView, View selectedItemView, int position, long id) { spinner2.setSelection(position); spinner3.setSelection(position); spinner4.setSelection(position); spinner5.setSelection(position); } public void onNothingSelected(AdapterView? arg0) { } }); spinner2.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView? parentView, View selectedItemView, int position, long id) { spinner1.setSelection(position); spinner3.setSelection(position); spinner4.setSelection(position); spinner5.setSelection(position); } public void onNothingSelected(AdapterView? arg0) { } The position, I put as argument to setSelection method is the position of selected item. Hope this will help you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Help
On Sun, May 20, 2012 at 12:39 AM, Ashintha Rukmal ashin...@gmail.comwrote: I used setOnItemSelectedListner and it worked for the 1st spinner.. but others don't work. here's my code for 1st 2 spinners. any solution? Debug your app. At the very least, explain what other don't work means and give us all the information you've discovered for yourself while trying to solve your problem. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner Help
Hi,, I'm new to android developing... I'm developing a simple app that have 5 spinners.. when I select 1 item in a spinner I want to auto select other spinner items that equals to the selected item position. I used setOnItemSelectedListner and it worked for the 1st spinner.. but others don't work. here's my code for 1st 2 spinners. any solution? spinner1.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView? parentView, View selectedItemView, int position, long id) { int pos1=spinner1.getSelectedItemPosition(); spinner2.setSelection(pos1); spinner3.setSelection(pos1); spinner4.setSelection(pos1); spinner5.setSelection(pos1); } public void onNothingSelected(AdapterView? arg0) { } }); spinner2.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView? parentView, View selectedItemView, int position, long id) { int pos2=spinner2.getSelectedItemPosition(); spinner1.setSelection(pos2); spinner3.setSelection(pos2); spinner4.setSelection(pos2); spinner5.setSelection(pos2); } public void onNothingSelected(AdapterView? arg0) { } }); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner Help
Hi,, I'm new to android developing.. I'm trying to make a simple app that contains 5 spinners. When I select one item in a spinner I want to auto select other spinner items that equals to selected item position. I used setOnItemSelected listner and it worked for the 1st spinner. But when I select item in another spinner nothing will happen.. here's my code for 1st two spinners. Any solution spinner.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView? parentView, View selectedItemView, int position, long id) { int pos1=spinner.getSelectedItemPosition(); spinner1.setSelection(pos1); spinner2.setSelection(pos1); spinner3.setSelection(pos1); spinner4.setSelection(pos1); } public void onNothingSelected(AdapterView? arg0) { } }); spinner1.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView? parentView, View selectedItemView, int position, long id) { int pos2=spinner.getSelectedItemPosition(); spinner.setSelection(pos2); spinner2.setSelection(pos2); spinner3.setSelection(pos2); spinner4.setSelection(pos2); } public void onNothingSelected(AdapterView? arg0) { } }); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Help
int pos2=spinner.getSelectedItemPosition(); Shouldn't this line be the following? *int pos2 = spinner1.getSelectedItemPosition();* Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, May 21, 2012 at 9:47 AM, Ashintha Rukmal ashin...@gmail.com wrote: int pos2=spinner.getSelectedItemPosition(); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner In TabWidget Bad Token Exception
I'm fairly new to Android and Java for that matter, and am having a context issue - I have a Spinner within a TabWidget within another TabWidget, and on the code side I have my main class which is a TabActivity, in which I set the intent of a particular tab to another TabActivity, in which I set the intent of a tab to an Activity which I set the content view to a layout where I have my Spinner (hopefully that made sense). Anytime I click on the spinner and it attempts to launch the dialog for the spinner it gives me a bad token error. From what I've read, it's because my spinner has the wrong context, but since I'm not actively setting my context (I created the spinner in XML), and I can't seem to find a method or exposed property to set the context of the spinner...well you get the point, I'm lost on this one despite reading other people's similar issues. Here's my code: Main: public class Star_Android_Activity extends TabActivity { public static void main(String[] args) { } public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TabHost tabHost = getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, Pick_Activity.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec(pick).setIndicator(LinearLayout.inflate(this,R.layout.tab_header_pick, null)) .setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(0); } } Sub-Tabs: public class Pick_Activity extends TabActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pick); TabHost tabHost = getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Reusable TabSpec for each tab Intent intent; // Reusable Intent for each tab intent = new Intent().setClass(this, Pending_Activity.class); spec = tabHost.newTabSpec(pending).setIndicator(LinearLayout.inflate(this,R.layout.tab_header_pending, null)) .setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(0); } } Child Activity: public class Pending_Activity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pending); addSpinnerValues(); } public void addSpinnerValues() { Spinner spn = (Spinner)findViewById(R.id.spnPick); ListString list = new ArrayListString(); list.add(list 1); list.add(list 2); list.add(list 3); ArrayAdapterString dataAdapter = new ArrayAdapterString(this, android.R.layout.simple_spinner_item, list); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spn.setAdapter(dataAdapter); } } The xml files for Main and and Pick are basically copies of the hello tabwidget tutorial, and my pending.xml is just a FrameLayout containing a few buttons and my spinner. I can post the code if it helps, but I was having issues posting anymore code (character limit perhaps). Any help on how to properly set my contexts (and a small explanation if it's not a hassle) would be greatly appreciated! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] spinner
Dear All, Let me know how to change the spinner list color when i click the spinner list. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] spinner
On Sun, Mar 18, 2012 at 12:29 PM, sri kanth sritullimi...@gmail.com wrote: Let me know how to change the spinner list color when i click the spinner list. Set your custom adapter for the Spinner, override getView to give you the View you desire with your custom color. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] spinner style from 4.0.3 to 2.3.3
hi, i'm a newbie. i made this app for 4.0.3 that has some spinners an textviews. it looks fine - everything has a black background. my target phone is a 2.3.3. spinner has grey/and white backgrounds. changing the background color works for the dropdown view and for the text view on the spinner, but not for the spinner itself. i belive this is because they us 9patches or something. looking in the platforms file and doing some diffs (please see below), it seems that the most of the xml files are the same except for one small difference. also the level 15 api has some extra files. is it possible to somehow make my app use these level 15 files (just for the spinners) on a level 10 platform? or is there a way to use a darker theme on the 2.3.3? thanks diff ./android-10/data/res/drawable/search_spinner.xml ./android-15/data/res/drawable/search_spinner.xml ./android-10/data/res/drawable/spinner_background.xml ./android-15/data/res/drawable/spinner_background.xml ./android-10/data/res/drawable/spinner_dropdown_background.xml ./android-15/data/res/drawable/spinner_dropdown_background.xml ./android-10/data/res/layout/simple_spinner_dropdown_item.xml ./android-15/data/res/layout/simple_spinner_dropdown_item.xml 25c25 android:layout_height=?android:attr/listPreferredItemHeight --- android:layout_height=?android:attr/dropdownListPreferredItemHeight ./android-10/data/res/layout/simple_spinner_item.xml ./android-15/data/res/layout/simple_spinner_item.xml 22c22 style=?android:attr/spinnerItemStyle --- style=?android:attr/spinnerItemStyle file: ./android-15/data/res/drawable/spinner_ab_holo_dark.xml ?xml version=1.0 encoding=utf-8? !-- Copyright (C) 2011 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_enabled=false android:drawable=@drawable/spinner_ab_disabled_holo_dark / item android:state_pressed=true android:drawable=@drawable/spinner_ab_pressed_holo_dark / item android:state_pressed=false android:state_focused=true android:drawable=@drawable/spinner_ab_focused_holo_dark / item android:drawable=@drawable/spinner_ab_default_holo_dark / /selector file: ./android-15/data/res/drawable/spinner_ab_holo_light.xml ?xml version=1.0 encoding=utf-8? !-- Copyright (C) 2010 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_enabled=false android:drawable=@drawable/spinner_ab_disabled_holo_light / item android:state_pressed=true android:drawable=@drawable/spinner_ab_pressed_holo_light / item android:state_pressed=false android:state_focused=true android:drawable=@drawable/spinner_ab_focused_holo_light / item android:drawable=@drawable/spinner_ab_default_holo_light / /selector file: ./android-15/data/res/drawable/spinner_background_holo_dark.xml ?xml version=1.0 encoding=utf-8? !-- Copyright (C) 2010 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_enabled=false android:drawable=@drawable/spinner_disabled_holo_dark / item android:state_pressed=true
Re: [android-developers] spinner background problems going from 4.0.3 to 2.3.3
On Tue, Feb 28, 2012 at 6:51 PM, Ray Tayek rta...@ca.rr.com wrote: don't bother setting the background. i did not have to set the background for the spinner in 4.0.3. You do not have to set it on 2.3.3 either. I, for example, am using various Spinners in my app, targeting 2.3.3, and have no issues with invisible arrows. Again, unless you're interested in skinning your app and applying your own themes or going crazy with colors, it's best just to leave all of that alone and just let the platform do its thing. Then, by default, it will look correct on any platform version (theoretically). - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] spinner background problems going from 4.0.3 to 2.3.3
hi, i made a small app that uses spinners on 4.0.3 that works fine. the target phone is 2.3.3. the background of the spinner and the list is dark on 4.0.3 and it is light on 2.3.3, so i set the background of the spinner to dark. this works fine except that the little arrow on the spinner that you click is now invisible :( is there any workaround for this? thanks --- co-chair http://ocjug.org/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] spinner background problems going from 4.0.3 to 2.3.3
On Tue, Feb 28, 2012 at 6:29 PM, Ray Tayek rta...@ca.rr.com wrote: is there any workaround for this? Unless you are prepared to override the theme completely, don't bother setting the background. Let the default platform version themes prevail. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] spinner background problems going from 4.0.3 to 2.3.3
At 04:39 PM 2/28/2012, you wrote: On Tue, Feb 28, 2012 at 6:29 PM, Ray Tayek mailto:rta...@ca.rr.comrta...@ca.rr.com wrote: is there any workaround for this? Unless you are prepared to override the theme completely, not unless i have to. don't bother setting the background. i did not have to set the background for the spinner in 4.0.3. Let the default platform version themes prevail. i'm a real newbie. are there any choices for themes in 2.3.3? thanks --- co-chair http://ocjug.org/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner with a custom dialog (with a searchbox - EditText -, ListView with custom Adapter - results)
I`m really trying to find and implement a Spinner with a fully customized dialog. I need to show a searchable list when the Spinner is activated, and then this list will retrieve the selected object to the spinner. How can I do this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner with a custom dialog (with a searchbox - EditText -, ListView with custom Adapter - results)
On Tue, Jan 31, 2012 at 6:36 AM, Mateus Barni matba...@gmail.com wrote: I need to show a searchable list when the Spinner is activated, and then this list will retrieve the selected object to the spinner. How can I do this? Grab the Spinner source, see how it manages its dialog, then retrofit it to use your custom dialog. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner example has no prompt
Since you mentioned 4.0.3 and api level 15... With Holo themes, spinners are no longer popup dialogs - they are dropdown lists, so there is no title. Adding a text label to the layout somewhere near the spinner should work. -- Kostya 25 января 2012 г. 8:20 пользователь Ray Tayek rta...@ca.rr.com написал: At 07:07 PM 1/24/2012, you wrote: At 02:21 AM 1/23/2012, you wrote: At 07:29 PM 1/21/2012, Ray Tayek wrote: hi, newbie here. ... running the spinner example shows earth. the prompt is not visible also, the spinner prompts in my project are not visible... found clue: http://groups.google.com/**group/android-developers/** browse_thread/thread/**d93ce1ef583a2a29http://groups.google.com/group/android-developers/browse_thread/thread/d93ce1ef583a2a29 more clues: more clues: http://stackoverflow.com/** questions/867518/how-to-make-**an-android-spinner-with-** initial-text-select-onehttp://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one has anyone seen a prompt in a spinner in without some special code using 4.0.3 spi level 15? thanks --- co-chair http://ocjug.org/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@**googlegroups.comandroid-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner example has no prompt
At 07:52 AM 1/25/2012, you wrote: Since you mentioned 4.0.3 and api level 15... With Holo themes, spinners are no longer popup dialogs - they are dropdown lists, sošthere is no title.š Adding a text label to the layout somewhere near the spinner should work. yes, but that would take up more real estate. i ended up adding a prompt string as the first element in the list model when i made the array adapter. and then removed it when the user made a choice that was not the prompt. is this a sane thing to do? or is there a better way? maybe change adapters when the user makes a choice that was not the prompt? thanks 25 ÑÎ×ÁÒÑ 2012šÇ. 8:20 ÐÏÌØÚÏ×ÁÔÅÌØ Ray Tayek mailto:rta...@ca.rr.comrta...@ca.rr.com ÎÁÐÉÓÁÌ: At 07:07 PM 1/24/2012, you wrote: At 02:21 AM 1/23/2012, you wrote: At 07:29 PM 1/21/2012, Ray Tayek wrote: hi, newbie here. ... running the spinner example shows earth. the prompt is not visible also, the spinner prompts in my project are not visible... found šclue: http://groups.google.com/group/android-developers/browse_thread/thread/d93ce1ef583a2a29http://groups.google.com/group/android-developers/browse_thread/thread/d93ce1ef583a2a29 more clues: more clues: http://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-onehttp://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one has anyone seen a prompt in a spinner in without some special code using 4.0.3 spi level 15? thanks --- co-chair http://ocjug.org/http://ocjug.org/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to mailto:android-developers@googlegroups.comandroid-developers@googlegroups.com To unsubscribe from this group, send email to mailto:android-developers%2bunsubscr...@googlegroups.comandroid-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en --- co-chair http://ocjug.org/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner example has no prompt
At 02:21 AM 1/23/2012, you wrote: At 07:29 PM 1/21/2012, Ray Tayek wrote: hi, newbie here. ... running the spinner example shows earth. the prompt is not visible also, the spinner prompts in my project are not visible... found clue: http://groups.google.com/group/android-developers/browse_thread/thread/d93ce1ef583a2a29 thanks --- co-chair http://ocjug.org/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner example has no prompt
At 07:07 PM 1/24/2012, you wrote: At 02:21 AM 1/23/2012, you wrote: At 07:29 PM 1/21/2012, Ray Tayek wrote: hi, newbie here. ... running the spinner example shows earth. the prompt is not visible also, the spinner prompts in my project are not visible... found clue: http://groups.google.com/group/android-developers/browse_thread/thread/d93ce1ef583a2a29 more clues: more clues: http://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one has anyone seen a prompt in a spinner in without some special code using 4.0.3 spi level 15? thanks --- co-chair http://ocjug.org/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner example has no prompt
At 07:29 PM 1/21/2012, Ray Tayek wrote: hi, newbie here. ... running the spinner example shows earth. the prompt is not visible also, the spinner prompts in my project are not visible... my question is: is the prompt supposed to work as implemented in the spinner example? printling spinner.getPrompt() shows the correct text. anybody got a clue? thanks --- co-chair http://ocjug.org/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner itemselectedlistener not working after extending ArrayAdapter
In the onCreate method I define this: userNameSpinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? parentView, View selectedItemView, int position, long id) { Log.i(TAG, position); } }); In onResume and after calling a dialog where a new row can be added to my list I call this, and it displays the Spinner as I expect when I touch it, but, the OnItemSelectedListener doesn't appear to be working, as it never calls the Log method in onItemSelected. I am curious what I did wrong, or if my order is wrong. userNameSpinner.setAdapter(new ArrayAdapterString(mContext, android.R.layout.simple_list_item_1, mylist .toArray(new String[0])) { @Override public View getDropDownView(int position, View convertView, android.view.ViewGroup parent) { View v = convertView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTarget); tv.setText(mylist.get(position)); tv.setTextColor(Color.RED); return v; } }); -- I know that you believe you understand what you think I said, but I'm not sure you realize that what you heard is not what I meant. - Robert McCloskey -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner itemselectedlistener not working after extending ArrayAdapter
You are probably setting/un-setting the listener somewhere else as well in your code. May be in the on pause method. *Thanks and Regards, Kumar Bibek* * http://techdroid.kbeanie.com http://www.kbeanie.com* On Tue, Jan 24, 2012 at 7:54 AM, James Black planiturth...@gmail.comwrote: In the onCreate method I define this: userNameSpinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? parentView, View selectedItemView, int position, long id) { Log.i(TAG, position); } }); In onResume and after calling a dialog where a new row can be added to my list I call this, and it displays the Spinner as I expect when I touch it, but, the OnItemSelectedListener doesn't appear to be working, as it never calls the Log method in onItemSelected. I am curious what I did wrong, or if my order is wrong. userNameSpinner.setAdapter(new ArrayAdapterString(mContext, android.R.layout.simple_list_item_1, mylist .toArray(new String[0])) { @Override public View getDropDownView(int position, View convertView, android.view.ViewGroup parent) { View v = convertView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTarget); tv.setText(mylist.get(position)); tv.setTextColor(Color.RED); return v; } }); -- I know that you believe you understand what you think I said, but I'm not sure you realize that what you heard is not what I meant. - Robert McCloskey -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner example has no prompt
hi, newbie here. i downloaded the sdk and the eclipse plugin a few days ago. running the spinner example shows earth. the prompt is not visible in the emulator. also, the spinner prompts in my project are not visible in the emulator. stackoverflow has some info: http://stackoverflow.com/questions/7632504/android-spinner-prompt-text-not-showing http://stackoverflow.com/questions/7314685/android-spinner-prompt-not-working http://stackoverflow.com/questions/8925519/prompt-in-spinner-with-drop-down-feature my question is: is the prompt supposed to work as implemented in the spinner example? most of the links show some hack by adding a first element that says please select a planet. does one need to do this type of thing or does the prompt actually work as advertised? thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner spinning twice...
I am having issues with spinner for the past 2 days. And then I isolated the problem by using the working Spinner tutorial at http://developer.android.com/resources/tutorials/views/hello-spinner.html So I am able to reproduce the issue. The code is exactly same as mentioned in the above link. Then I modified the selection listener as: spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? arg0, View arg1, int pos, long id) { Log.i(TAG, SPINNER SELECTED pos: + pos + id: + id); } @Override public void onNothingSelected(AdapterView? arg0) { // TODO Auto-generated method stub } }); Now if I select Mercury which is the first element and change orientation then this log statement is called once. If I choose Earth which is the third element and change orientation then this log statement is called twice with same values of pos, id etc. pretty much with in a short span. And so on. So my question is this a bug? Am I missing some thing? As this leads to lot of issues when I using Loaders or AsyncTask etc. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner spinning twice...
On Tue, Dec 27, 2011 at 7:37 PM, havexz bali.param...@gmail.com wrote: So my question is this a bug? Mildly surprising, but I personally would not qualify it as being a bug. There are no rules stipulating how frequently onItemSelected() will be called on a configuration change when the activities are being destroyed and recreated. As this leads to lot of issues when I using Loaders or AsyncTask etc. Then your app has other problems. The user is perfectly capable of using their finger and changing the selection of a Spinner as many times as the user wants. If you are using fragments, make the fragment holding the Spinner be a dynamic fragment (created via a FragmentTransaction) and use setRetainInstance(true), and this will probably avoid any onItemSelected() calls being made as part of a configuration change. If you are not using fragments, use onSaveInstanceState() and/or onRetainNonConfigurationInstance() to let the new activity know what the old activity started in terms of background operations, so you can not only detect the configuration change but also deal with its repercussions. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in NYC: http://marakana.com/training/android/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] spinner on FragmentActivity
On Thu, Nov 3, 2011 at 2:40 AM, sourabh sahu souruit...@gmail.com wrote: I have created a Spinner on FragmentActivity, but on a click of a spinner it crashes.Please suggest how to resolve it. http://tinyurl.com/5vkmu5e - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] spinner on FragmentActivity
I have created a Spinner on FragmentActivity, but on a click of a spinner it crashes.Please suggest how to resolve it. Thanks, Sourabh -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] spinner on FragmentActivity
Provide some logs. :) *Thanks and Regards, Kumar Bibek* * http://techdroid.kbeanie.com http://www.kbeanie.com* On Thu, Nov 3, 2011 at 1:10 PM, sourabh sahu souruit...@gmail.com wrote: I have created a Spinner on FragmentActivity, but on a click of a spinner it crashes.Please suggest how to resolve it. Thanks, Sourabh -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner , truncate text instead of wrap text
it does work thank you for your help -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner , truncate text instead of wrap text
Hi all, the text displayed in spinner will be wrap when it is too long, but I expect it will truncate the text instead of wrap it. Is it possible??? Thx everyone -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner , truncate text instead of wrap text
On Wed, Sep 7, 2011 at 10:16 AM, JI jacky1...@gmail.com wrote: Is it possible??? Probably - you can set the view that is used in spinner, and on that you can probably set whether it wraps or not. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner question
Hi, I have an activity with three spinners and am having trouble retrieving the data from them. The code below is not yielding the desired results. Any help is appreciated. Spinner spinner = (Spinner)findViewById(R.id.origin); ArrayAdapterCharSequence o_adapter = ArrayAdapter.createFromResource( this, R.array.origin_array, android.R.layout.simple_spinner_item); o_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(o_adapter); spinner = (Spinner)findViewById(R.id.destination); ArrayAdapterCharSequence d_adapter = ArrayAdapter.createFromResource( this, R.array.destination_array, android.R.layout.simple_spinner_item); d_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(d_adapter); spinner = (Spinner)findViewById(R.id.triptype); ArrayAdapterCharSequence t_adapter = ArrayAdapter.createFromResource( this, R.array.triptype_array, android.R.layout.simple_spinner_item); t_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(t_adapter); spinner.setOnItemSelectedListener(new MyOnItemSelectedListener()); public class MyOnItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView? parent, View view, int pos, long id) { parent.getItemAtPosition(pos).toString(); switch(view.getId()){ case R.id.origin: ORIGIN = parent.getItemAtPosition(pos).toString(); break; case R.id.destination: DESTINATION = parent.getItemAtPosition(pos).toString(); break; case R.id.triptype: TRIP_TYPE = parent.getItemAtPosition(pos).toString(); break; } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner question
On Tue, Jul 26, 2011 at 1:39 PM, Ab Caballero a...@mac.com wrote: I have an activity with three spinners and am having trouble retrieving the data from them. The code below is not yielding the desired results. Any help is appreciated. Care to explain what the desired results and current undesired results are? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner box
Hi Please open the image.In the image Font Size is header and Standard is item.Header Font Size will always will be in the spinner but not in the item list.Item list just shows items. Is this possible to build this kind of spinner? if possible please guide me. thanks in advance. Regards Goutom -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=enattachment: spinneritem.png
[android-developers] Spinner value on button click
Dear all, Is it possible to return a spinner selected value only when I click in a button in the same activity, instead of using the OnItemSelected() method? Could you tell me how to proceed with it? Best Regards, -- Igor Smagasz Barros igorsmag...@gmail.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner value on button click
On Wed, Jul 20, 2011 at 2:52 PM, Igor Barros igorsmag...@gmail.com wrote: Is it possible to return a spinner selected value only when I click in a button in the same activity, instead of using the OnItemSelected() method? Yes. Could you tell me how to proceed with it? Read the docs for both Spinner and Button. There are functions to do exactly what you describe. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner usage
Thank you, I've re-written the adapter and it now works. On 17/07/2011 6:56 AM, TreKing wrote: On Sat, Jul 16, 2011 at 8:56 AM, Simon Platten simonaplat...@googlemail.com mailto:simonaplat...@googlemail.com wrote: When I'm not making a selection the spinner shows as an empty box with a down arrow, once I've made a selection the list is removed but the spinner still shows empty, shouldn't it show the current / last selection ? It should, but I suppose you could be doing something wonky in your adapter. Care to share that? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner Adapter problem
I have a spinner with a checkbox in it, here is the XML for the item: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=?android:attr/listPreferredItemHeight android:padding=10dp CheckBox android:id=@+id/chkBox android:layout_width=fill_parent android:layout_height=wrap_content android:text=Folder name android:textColor=@color/black android:soundEffectsEnabled=true/ /RelativeLayout Here is the adapter code: public class spAdapter extends BaseAdapter implements OnClickListener { private ArrayListString m_arySelItems = new ArrayListString(); private LayoutInflater m_layoutInfater; private ArrayListString m_aryFolders; public spAdapter(Context context, int textViewResourceId, ArrayListString aryFolders) { m_aryFolders = aryFolders; m_layoutInfater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); } public void add(String item) { m_aryFolders.add(item); } public void clear() { m_aryFolders.clear(); } public int getCount() { return m_aryFolders.size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { View vi = convertView; try{ // Get the Actual Image from the Array String strFolder = m_aryFolders.get(position); if ( vi == null ) { vi = m_layoutInfater.inflate(R.layout.spfolders, null); } CheckBox chkBox = (CheckBox)vi.findViewById(R.id.chkBox); chkBox.setText(strFolder); chkBox.setTag(strFolder); if ( m_arySelItems.contains(strFolder) ) { chkBox.setChecked(true); } chkBox.setOnClickListener(this); } catch( Exception ex ) { Log.e( TAG, ex.getMessage() ); } return vi; } @Override public void onClick(View v) { CheckBox chkBox = (CheckBox)v; String strFolder = (String)chkBox.getTag(); if ( chkBox.isChecked() ) { if ( m_arySelItems.contains(strFolder) == false ) { m_arySelItems.add(strFolder); } } else { if ( m_arySelItems.contains(strFolder) == true ) { m_arySelItems.remove(strFolder); } } } } I've done something wrong in the getView, something is missing because when I scroll off view, any selections get mixed up. Is there a good example / tutorial where I can find out how to implement this correctly? Thank you, -- Regards, Sy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner usage
I've used a spinner with a Base Adapter. The spinner works fine and I can make selections, my question is: When I'm not making a selection the spinner shows as an empty box with a down arrow, once I've made a selection the list is removed but the spinner still shows empty, shouldn't it show the current / last selection ? The XML for my spinner looks like this: Spinner android:id=@+id/spCategories android:layout_width=fill_parent android:layout_height=wrap_content android:layout_below=@+id/ivFolder android:focusable=true android:focusableInTouchMode=true android:isScrollContainer=true/ The ivFolder looks like: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=?android:attr/listPreferredItemHeight android:padding=10dp TextView android:id=@+id/tvFolder android:layout_width=fill_parent android:layout_height=wrap_content android:text=File-name android:textColor=@color/black android:gravity=left/ /RelativeLayout Thank you, -- Regards, Sy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner usage
On Sat, Jul 16, 2011 at 8:56 AM, Simon Platten simonaplat...@googlemail.com wrote: When I'm not making a selection the spinner shows as an empty box with a down arrow, once I've made a selection the list is removed but the spinner still shows empty, shouldn't it show the current / last selection ? It should, but I suppose you could be doing something wonky in your adapter. Care to share that? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner did not got focus
thanx i solved this by using set focusable and focusableInTouchMode properties of spinner. On Thu, Jun 23, 2011 at 2:25 AM, TreKing treking...@gmail.com wrote: On Wed, Jun 22, 2011 at 10:44 AM, Waqas Ahmed thewaqa...@gmail.comwrote: Is there any way that spinner got the focus? Try Focusable and Focusable In Touch Mode properties. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner did not got focus
Hi, I am new to android I have created an application in which i use 4 edittext fields and 2 spinners in an activity. the order of these components are 2 edittext then 2 spinners and then 2 edittext fields. Problem that i have got is when i transfer focus (with the help of soft keyboard next button) from edittext to spiner, spinner did not get the focus and the focus is tranferd to edittext field that was placed after the spinners. I have used requestfocus() on spinner but it did not work. Is there any way that spinner got the focus? Regards, Waqas -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner did not got focus
On Wed, Jun 22, 2011 at 10:44 AM, Waqas Ahmed thewaqa...@gmail.com wrote: Is there any way that spinner got the focus? Try Focusable and Focusable In Touch Mode properties. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner
Is it possible to preload the spinner adapter with a list of item (either from database or from array) BUT to NOT run the selection while the screen is built or being displayed. But rather only called when the user has clicked and selected an item ? Currently I have a spinner and use the setOnItemSelectedListener But this is called when the screen is displayed BEFORE the user gets to actually select and item Thanks in advance -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner
On Mon, Jun 6, 2011 at 1:40 PM, New Developer secur...@isscp.com wrote: Is it possible to preload the spinner adapter with a list of item (either from database or from array) BUT to NOT run the selection while the screen is built or being displayed. But rather only called when the user has clicked and selected an item ? No, sorry. A Spinner always has a selection if there are 1+ items in the SpinnerAdapter. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner
On Mon, Jun 6, 2011 at 12:40 PM, New Developer secur...@isscp.com wrote: Currently I have a spinner and use the setOnItemSelectedListener But this is called when the screen is displayed BEFORE the user gets to actually select and item I set the first item to be a dummy prompt. So if item selected index == 0, ignore the selection. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner items missing selection radio button
Hey, i asked it at SO few days ago, no answer yet, hoped someone here will have an idea... (http://stackoverflow.com/questions/6146442/spinner-items-selection- radio-missing) When my items contains English and/or numeric signs, it shows the radio selection near the item, but when it doesn't contains any English and/or numeric signs (contains only Hebrew in my example) it does not show the radio selection near the item. For the adapters (array adapter) creation i used the layout android.R.layout.simple_spinner_item And before setting the Spinner adapter I did adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); The solution I found for now, is set the layout to simple_dropdown_item_1line; this solves the problem by not showing the radio button. Any ideas on how to get the radio button visible always? - correction - it does not solve the problem, in _few_ of my spinner the text is now whit (on a white background..) Thanks, Nadav -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner with added Text
Hi Using a Spinner Is there a way while using (or from the UI) to type in a new option Say I have a spinner with a list of calendars (actually list of .ics files) Now I want to create a NEW calendar Using a Spinner how do I type in the new name and it is added to the drop down list? thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner with added Text
You cant do that with a spinner. Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com On Mon, Apr 18, 2011 at 10:40 PM, New Developer secur...@isscp.com wrote: Hi Using a Spinner Is there a way while using (or from the UI) to type in a new option Say I have a spinner with a list of calendars (actually list of .ics files) Now I want to create a NEW calendar Using a Spinner how do I type in the new name and it is added to the drop down list? thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner with added Text
On Mon, Apr 18, 2011 at 12:10 PM, New Developer secur...@isscp.com wrote: Using a Spinner how do I type in the new name and it is added to the drop down list? One of you spinner items could be Add New Calendar... Clicking this you popup a dialog with an EditText. When user hits OK, you pass the value of the EditText to the adapter that backs the Spinner. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner like drop-down on button
On Fri, Mar 11, 2011 at 1:13 AM, Brad Stintson geek.bin...@gmail.comwrote: How to implement spinner like array adapter on button? http://www.catb.org/~esr/faqs/smart-questions.html - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner like drop-down on button
How to implement spinner like array adapter on button? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner Retrievation
* I have created list elements in spinner from strings.xml. * * I store element in database using spinner1.getSelectedItem().**toString(); * This code doesn't show how you store the info in the database. It shows how you get the data to be stored in the database. * How to retrieve that element from database?* That depends on the structure of your database... What exactly is the code you are using for putting the values in the database. On Sat, Mar 5, 2011 at 9:53 AM, Brad Stintson geek.bin...@gmail.com wrote: I have created list elements in spinner from strings.xml. I store element in database using spinner1.getSelectedItem().toString(); How to retrieve that element from database? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner Retrievation
I have created list elements in spinner from strings.xml. I store element in database using spinner1.getSelectedItem().toString(); How to retrieve that element from database? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner drop-down with blank lines
Hello, One of my users has reported a mysterious behaviour with a spinner which I so far have been unable to reproduce. When pressing the spinner, a list of blank (empty) items appears. Only when selecting an item does the spinner display the relevant text associated with the item. The number of blank lines correctly corresponds to the expected number of items in the spinner. Here is the code I use for populating the spinner, which is executed in the onPostExecute method of an AsyncTask: String[] spinnerArray = new String[]{...}; // array contents omitted. ArrayAdapterString adapter = new ArrayAdapterString(ctx, android.R.layout.simple_spinner_item, spinnerArray); spinner.setAdapter(adapter); spinner.setSelection(0); This is pretty standard as far as I can tell. Has anybody encountered behaviour similar to what is described above? Any idea what might be going wrong? Any suggestions would be greatly appreciated. Best, Michael. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner drop-down with blank lines
Well, it's just a problem of wrong text color on a custom UI from the manufacturer. Ask the user for the model of his phone and the OS version. I am sure, you can reproduce the problem on a similar device. Say, for example, your spinner items text color is black, which you have mentioned, and the default spinner layout that the custom UI uses has a black background, do you see the problem? Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com On Mon, Jan 17, 2011 at 11:50 PM, michael michael.d.peder...@googlemail.com wrote: Hello, One of my users has reported a mysterious behaviour with a spinner which I so far have been unable to reproduce. When pressing the spinner, a list of blank (empty) items appears. Only when selecting an item does the spinner display the relevant text associated with the item. The number of blank lines correctly corresponds to the expected number of items in the spinner. Here is the code I use for populating the spinner, which is executed in the onPostExecute method of an AsyncTask: String[] spinnerArray = new String[]{...}; // array contents omitted. ArrayAdapterString adapter = new ArrayAdapterString(ctx, android.R.layout.simple_spinner_item, spinnerArray); spinner.setAdapter(adapter); spinner.setSelection(0); This is pretty standard as far as I can tell. Has anybody encountered behaviour similar to what is described above? Any idea what might be going wrong? Any suggestions would be greatly appreciated. Best, Michael. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner drop-down with blank lines
Is this on the Droid X ? 2011/1/17 Kumar Bibek coomar@gmail.com Well, it's just a problem of wrong text color on a custom UI from the manufacturer. Ask the user for the model of his phone and the OS version. I am sure, you can reproduce the problem on a similar device. Say, for example, your spinner items text color is black, which you have mentioned, and the default spinner layout that the custom UI uses has a black background, do you see the problem? Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com On Mon, Jan 17, 2011 at 11:50 PM, michael michael.d.peder...@googlemail.com wrote: Hello, One of my users has reported a mysterious behaviour with a spinner which I so far have been unable to reproduce. When pressing the spinner, a list of blank (empty) items appears. Only when selecting an item does the spinner display the relevant text associated with the item. The number of blank lines correctly corresponds to the expected number of items in the spinner. Here is the code I use for populating the spinner, which is executed in the onPostExecute method of an AsyncTask: String[] spinnerArray = new String[]{...}; // array contents omitted. ArrayAdapterString adapter = new ArrayAdapterString(ctx, android.R.layout.simple_spinner_item, spinnerArray); spinner.setAdapter(adapter); spinner.setSelection(0); This is pretty standard as far as I can tell. Has anybody encountered behaviour similar to what is described above? Any idea what might be going wrong? Any suggestions would be greatly appreciated. Best, Michael. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner Style
Hi friends, As part of my project I need a spinner that should display items like HTML select tag rather opening a new window. Is it possible...? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner/drum roller control like native Clock app has for choosing hours/minutes
Hi all. I cannot find a corresponding control anywhere. The control I am interested in is iPhone's spinner. It's much simpler to use than Android's TimePicker. Since I see that native Clock app has it, does anyone know how is that control called and how can one use it in his app ? Thanks, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner/drum roller control like native Clock app has for choosing hours/minutes
On Fri, Nov 12, 2010 at 6:17 AM, Hatch tomislav.hecimo...@gmail.com wrote: I cannot find a corresponding control anywhere. The control I am interested in is iPhone's spinner. It's much simpler to use than Android's TimePicker. Since I see that native Clock app has it, does anyone know how is that control called and how can one use it in his app ? Android does not have a native Clock app. The Clock application from the Android open source project does not use a Spinner/drum roller control, at least from what I can tell on my Nexus One. Perhaps you are thinking of some other clock app. Regardless, I suspect that what you want can be found here: http://code.google.com/p/android-wheel/ -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner/drum roller control like native Clock app has for choosing hours/minutes
I needed the same thing awhile ago and couldn't find a good implementation of it anywhere. What I came up with was I embedded a WebView control in my AlertDialog, and used Javascript to control the spinner. What I did was create a web page with the information I wanted to scroll in the background and moved it up and down with the Javascript. It works well.. and looks good, but it was a pain to program. Hope you find an easier way. There was a fairly long thread on it on (I think) osdir.com.. and I took the basic idea from there. Sincerely, Brad Gies --- Bistro Bot - Bistro Blurb http://bgies.comhttp://nocrappyapps.com http://bistroblurb.com http://forcethetruth.com http://ihottonight.com --- Everything in moderation, including abstinence (paraphrased) Every person is born with a brain... Those who use it well are the successful happy ones - Brad Gies Adversity can make or break you... It's your choice... Choose wisely - Brad Gies Never doubt that a small group of thoughtful, committed people can change the world. Indeed. It is the only thing that ever has - Margaret Mead On 12/11/2010 3:17 AM, Hatch wrote: Hi all. I cannot find a corresponding control anywhere. The control I am interested in is iPhone's spinner. It's much simpler to use than Android's TimePicker. Since I see that native Clock app has it, does anyone know how is that control called and how can one use it in his app ? Thanks, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner: crash when selected
Hello, I don't understand why my spinner crash as soon i select it. My code: Spinner chooseCategorySpinner = (Spinner)findViewById(R.id.spinner); testArray = ArrayAdapter.createFromResource(this, R.array.planets, android.R.layout.simple_spinner_item); testArray.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); chooseCategorySpinner.setAdapter(testArray); chooseCategorySpinner.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView? parent, View view, int position, long id) { } public void onNothingSelected(AdapterView? parent) { } }); The error stack: W/WindowManager( 54): Attempted to add window with non-application token WindowToken{438af588 token=null}. Aborting. D/AndroidRuntime( 2680): Shutting down VM W/dalvikvm( 2680): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) E/AndroidRuntime( 2680): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 2680): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application E/AndroidRuntime( 2680):at android.view.ViewRoot.setView(ViewRoot.java:460) E/AndroidRuntime( 2680):at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177) E/AndroidRuntime( 2680):at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) E/AndroidRuntime( 2680):at android.app.Dialog.show(Dialog.java:238) E/AndroidRuntime( 2680):at android.app.AlertDialog $Builder.show(AlertDialog.java:802) E/AndroidRuntime( 2680):at android.widget.Spinner.performClick(Spinner.java:257) E/AndroidRuntime( 2680):at android.view.View.onTouchEvent(View.java: 4133) E/AndroidRuntime( 2680):at android.view.View.dispatchTouchEvent(View.java:3672) E/AndroidRuntime( 2680):at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:850) E/AndroidRuntime( 2680):at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 2680):at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 2680):at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 2680):at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 2680):at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 2680):at com.android.internal.policy.impl.PhoneWindow $DecorView.superDispatchTouchEvent(PhoneWindow.java:1712) E/AndroidRuntime( 2680):at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java: 1202) E/AndroidRuntime( 2680):at android.app.Activity.dispatchTouchEvent(Activity.java:1987) E/AndroidRuntime( 2680):at com.android.internal.policy.impl.PhoneWindow $DecorView.dispatchTouchEvent(PhoneWindow.java:1696) E/AndroidRuntime( 2680):at android.view.ViewRoot.handleMessage(ViewRoot.java:1658) E/AndroidRuntime( 2680):at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 2680):at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 2680):at android.app.ActivityThread.main(ActivityThread.java:4203) E/AndroidRuntime( 2680):at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 2680):at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 2680):at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:791) E/AndroidRuntime( 2680):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) E/AndroidRuntime( 2680):at dalvik.system.NativeStart.main(Native Method) I/Process ( 54): Sending signal. PID: 2680 SIG: 3 I/dalvikvm( 2680): threadid=7: reacting to signal 3 I/dalvikvm( 2680): Wrote stack trace to '/data/anr/traces.txt' I/Process ( 2680): Sending signal. PID: 2680 SIG: 9 I don't understand why this simple thing doesn't work ... Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Spinner: crash when selected
On Mon, Oct 25, 2010 at 9:39 AM, Khetzal quetz...@gmail.com wrote: E/AndroidRuntime( 2680): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application This terribly-word error message usually arises when you use getApplicationContext() to show a dialog. Are you using getApplicationContext() anywhere? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner in ListView Activity
Hi, Has anyone seen a a onItemSelected not being called when using a spinner inside a listviewActivity. I have the code below Inside a listViewActivity. protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.listview); Spinner sortOption = new Spinner(this); String[] items = CursorCollection.getSortOptions(this); sortOption.setOnItemSelectedListener(this); ArrayAdapterString adapter = new ArrayAdapterString(this,android.R.layout.simple_spinner_item, items); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); searchButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { sortOption.performClick(); } }); } public void onItemSelected(AdapterView? parent, View v, int position, long id) { Log.V(Info, Doing some stuff); } The spinner is shown on screen by pressing a button (not the spinner) which in turn calls performClick() on the spinner. When I select an item from the spinner the onItemSelected function is not called. Does anyone know why this might be? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en