I had an android UI from sample which is shown below
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:weightSum="1" android:layout_height="wrap_content">
<TextView android:text="data1:"
android:id="@+id/data1Label"
android:layout_weight="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView android:text="data2:"
android:id="@+id/data2Label"
android:layout_weight="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
<ListView android:id="@+id/in"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stackFromBottom="true"
android:transcriptMode="alwaysScroll"
android:layout_weight="1"
/>
</LinearLayout>
Then I needed to add a combobox after the top label panel and, I added a Spinner component like below
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:weightSum="1" android:layout_height="wrap_content">
<TextView android:text="data1:"
android:id="@+id/data1Label"
android:layout_weight="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView android:text="data2:"
android:id="@+id/data2Label"
android:layout_weight="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
<Spinner
android:id="@+id/cmd_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ListView android:id="@+id/in"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stackFromBottom="true"
android:transcriptMode="alwaysScroll"
android:layout_weight="1"
/>
</LinearLayout>
And In my Strings.xml resource file I added the data list for the spinner.
<string-array name="cmd_array">
<item>cmd1</item>
<item>cmd2</item>
<item>cmd3</item>
</string-array>
Then at the end of on create method of my activity class I added below method to set data to the spinner
Spinner spinner = (Spinner) findViewById(R.id.cmd_spinner);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.cmd_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
But when I run my app it does not show me the spinner. Any idea about the issue?
UPDATE
I am compiling my application as a android libaray project and the main activity is starting from Unity Game Engine.