android.widget.Spinner.getItemIdAtPosition()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(179)

本文整理了Java中android.widget.Spinner.getItemIdAtPosition()方法的一些代码示例,展示了Spinner.getItemIdAtPosition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.getItemIdAtPosition()方法的具体详情如下:
包路径:android.widget.Spinner
类名称:Spinner
方法名:getItemIdAtPosition

Spinner.getItemIdAtPosition介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

mIntent.putExtra("lang", m_myDynamicSpinner.getItemIdAtPosition(position));
System.out.println("Spinner value...."+m_myDynamicSpinner.getSelectedItem().toString());
startActivity(mIntent);

代码示例来源:origin: com.albedinsky.android/ui-widget-input

/**
 * Delegate method for {@link android.widget.Spinner#getItemIdAtPosition(int)}.
 */
public long getItemIdAtPosition(int position) {
  return mSpinner != null ? mSpinner.getItemIdAtPosition(position) : -1;
}

代码示例来源:origin: com.albedinsky.android/ui

/**
 * Delegate method for {@link android.widget.Spinner#getItemIdAtPosition(int)}.
 */
public long getItemIdAtPosition(int position) {
  return mSpinner != null ? mSpinner.getItemIdAtPosition(position) : -1;
}

代码示例来源:origin: dsolonenko/financisto

@Override
protected void restorePreferences() {
  SharedPreferences preferences = getPreferences(MODE_PRIVATE);
  Spinner dateFormats = (Spinner) findViewById(R.id.spinnerDateFormats);
  dateFormats.setSelection(preferences.getInt(QIF_IMPORT_DATE_FORMAT, 0));
  edFilename = (EditText) findViewById(R.id.edFilename);
  edFilename.setText(preferences.getString(QIF_IMPORT_FILENAME, ""));
  long currencyId = preferences.getLong(QIF_IMPORT_CURRENCY, 0);
  Spinner currencySpinner = (Spinner)findViewById(R.id.spinnerCurrency);
  int count = currencySpinner.getCount();
  for (int i=0; i<count; i++) {
    if (currencyId == currencySpinner.getItemIdAtPosition(i)) {
      currencySpinner.setSelection(i);
      break;
    }
  }
}

代码示例来源:origin: stackoverflow.com

for(int i=0;i<spin.getCount();i++)
  long id=spin.getItemIdAtPosition(i);
  if(id==emp.getDept())
    emp.setAge(String.valueOf(txtAge.getText().toString()));                                    emp.setDept((int)spin.getItemIdAtPosition(spin.getSelectedItemPosition()));

代码示例来源:origin: stackoverflow.com

mIntent.putExtra("lang", m_myDynamicSpinner.getItemIdAtPosition(position));
System.out.println("Spinner value...."+m_myDynamicSpinner.getSelectedItem().toString());
startActivity(mIntent);

相关文章