我试图用字符串列表填充 Spinner。他在android中编译并运行,但是当我在Spinner中输入触摸时,程序停止并返回此错误:
android.content.res.Resources$NotFoundException:资源 ID #0x7f090003 类型 #0x12 无效
protected void onPostExecute(List<String> myList)
{
if (!myList.isEmpty())
{
ArrayAdapter<String> adp = new ArrayAdapter<String>(MyActivity.this, android.R.layout.simple_spinner_item, myList);
adp.setDropDownViewResource(R.id.mySpinner);
mySpinner.setAdapter(adp);
}
else
{
Toast.makeText(getApplicationContext(), "Warning.", Toast.LENGTH_SHORT).show();
Intent i = new Intent(myActivity.this, Preferences.class);
startActivity(i);
}
}