嘿,我想知道如果有人可以幫我編輯我的代碼來顯示文本視圖而不是類。謝謝你的幫助。如何讓Spinner顯示TextView的選定項目
目前代碼:
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
String classSpot = classes[pos];
try {
Class nextClass = Class.forName("com.example.famouspeople." + classSpot);
final Context context = this;
Intent intent = new Intent(context,nextClass);
startActivity(intent);
}
catch(ClassNotFoundException e){
e.printStackTrace();
}
}
你想要什麼?如果你從微調選擇項目,那麼更新textview中的文本? – Sajmon 2013-03-13 21:42:38
@sajmon_d對不起,我在佈局中有6個與此類相匹配的文本視圖。它們都設置爲可見性「消失」,我希望將與微調器中的項目相對應的項目設置爲可見。 – Thomas 2013-03-13 21:45:04