0
countryCodeSpinner
在下面的代码片段中显示为null
。微调框返回null
countryCodeSpinner = (Spinner) findViewById(R.id.spinner_country);
countryCodeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
selectedCountryCode = (Long) selectedItemView.findViewById(R.id.country_name).getTag();
}
代码遍布全球,请更正。并为代码添加一些上下文。 – iMan
也许你的布局中没有R.id.spinner_country的资源。 请确保您选择了正确的布局 – Adnan
@avinash tiwari refere [this](http://stackoverflow.com/help/how-to-ask)befor提问 – Nikhil