안드로이드 개발 질문/답변
(글 수 45,052)
스피너 처음값에 다른 액티비티로 넘어가는 값을 넣어놨는데
스피너가 있는 액티비티 가자마자 바로 처음 값 액티비티로 넘어가서요
처음값을 디폴트 할수 있는 방법을 가르쳐주세요
int posit;
Class[] cls = {Sub1.class, Sub2.class, Sub3.class, Sub4.class, Sub5.class, Sub6.class, Sub7.class,};Spinner spinner;
AdapterView.OnItemSelectedListener iHand =
new AdapterView.OnItemSelectedListener() {@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int position, long arg3) {posit = position;
Intent intent = new Intent(SubMainActivity.this, cls[posit]);
startActivity(intent);
}
public void onNothingSelected(AdapterView<?> arg0) {}
};



