Tag Archives: spinner

8,841 views

Spinner Text Size Android Example

Spinner _spin1 = (Spinner) findViewById(R.id.spinLangFirst); ArrayAdapter<String> adapterJazyky = new ArrayAdapter<String>(this, R.layout.spinner_text_layout.xml, {"one","two","etc…."}); adapterJazyky.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spin1.setAdapter(adapterJazyky); spinner_text_layout.xml <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/spinnerText" android:layout_width="fill_parent" android:layout_height="wrap_content"   android:textSize="20sp" />

Posted in Android Examples Code | Tagged , | Comments Off on Spinner Text Size Android Example
9,028 views

Spinner ComboBox DropDown set on selected item listener setOnItemSelectedListener Java Android example

Spinner, ArrayAdapter, setOnItemSelectedListener, onItemSelected, setDropDownViewResource MainClass.java public class Vypocet extends Activity { Spinner hSpinnerMetry; // ……. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);   hSpinnerMetry = (Spinner) findViewById(R.id.idSpinnerMetry); ArrayAdapter<CharSequence> adapterMetry = ArrayAdapter.createFromResource( this, R.array.metry_array, android.R.layout.simple_spinner_item); adapterMetry.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); hSpinnerMetry.setAdapter(adapterMetry);   hSpinnerMetry.setOnItemSelectedListener( new … Continue reading

Posted in Android Examples Code | Tagged , , , , , , | Comments Off on Spinner ComboBox DropDown set on selected item listener setOnItemSelectedListener Java Android example
69,795 views

Spinner ComboBox DropDown List Android example code

Spinner in Android application is equivalent of ComboBox in WinApi. Spinner get selected item to string example. Spinner get selected item position to int example. Main activity class MainComboBox.java public class MainComboBox extends Activity { @Override public void onCreate(Bundle savedInstanceState) … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Spinner ComboBox DropDown List Android example code