我在一项活动中有两个微调器。 第一个微调器有数据,但第二个微调器是空的。 这是我的代码:
final YAxisSpinnerAdapter leftYAxisSpinnerAdapter = new YAxisSpinnerAdapter(mContext, android.R.layout.simple_spinner_item, getResources().getStringArray(R.array.signal_type));
leftYAxisSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
leftYAxis_Spinner.setAdapter(leftYAxisSpinnerAdapter);
leftYAxis_Spinner.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
Log.d(TAG, "Left Y Axix selected value"+leftYAxisSpinnerAdapter.getItem(position));
}
});
final YAxisSpinnerAdapter rightYAxisSpinnerAdapter = new YAxisSpinnerAdapter(mContext, android.R.layout.simple_spinner_item, getResources().getStringArray(R.array.right_signal_type));
rightYAxisSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
rightYAxis_Spinner.setAdapter(rightYAxisSpinnerAdapter);
rightYAxis_Spinner.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
Log.d(TAG, "Right Y Axix selected value"+rightYAxisSpinnerAdapter.getItem(position));
}
});