while(introll != 1000)
{
introll = Integer.parseInt(strroll); //sting을 int 으로
Cursor cursor = db.rawQuery("select _id from tb_steve where code = ?",new String[] {strroll});
while (cursor.moveToNext()) {
bookcheckview.setText(cursor.getString(0));
}
introll++;
strroll = Integer.toString(introll); //int를 string으로
rollbook = bookcheckview.getText().toString(); //저장
if(rollbook.equals("1") )
{
book_btn1.setVisibility(View.VISIBLE);
}
else
{
book_btn1.setVisibility(View.GONE);
}
}
반복문으로 sql에 있는 값 1000개를 검사해서 보이고 안보이고 하게 만들려고 합니다.
if문에서 book_btn1 이 btn2,btn3 이런식으로 1000까지있는데 일일이 적을수가없어서요 ㅠㅠ
book_btn1을 변수로지정하는 법 있을까요? 변수로 되면 하나씩 ++해주면 되자나요