2 つのスピナーと 2 つのボタンを備えたカスタム ダイアログ ボックスを作成しようとしています。私は次のコーディングを行っています
これは、ダイアログ ボックス内のカスタム GUI の xml です。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SORT BY" />
<Spinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:prompt="@string/prompt1"
android:entries="@array/ordersortby"
android:layout_gravity="center"/>
<TextView
android:id="@+id/textView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="ORDER"
/>
<Spinner
android:id="@+id/spinner2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:prompt="@string/address"
android:entries="@array/ordersortby1"
/>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OK" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
/>
文字列で私は次のように宣言しています
<string name="prompt1">Order Number</string>
<string-array name="ordersortby">
<item>Order Number</item>
<item>Date Submitted</item>
<item>Date Entered</item>
</string-array>
<string-array name="ordersortby1">
<item>ASC</item>
<item>DESC</item>
</string-array>
そして活動中、私は次のことをしています
final Dialog dialog = new Dialog(orders.this);
dialog.setContentView(R.layout.orderpicker);
dialog.setTitle("Sort By Dialog");
dialog.show();
これを実行すると、この スピナーが得られます
私の問題は、これらのピッカー内でデータを取得できない理由です。私を助けてください。