영단어 어플 구현중인데요 핸들러를 만들어서 북마크 기능을 구현하고 있는데 전역변수 설정해서 잘 했는데
문제는 북마크를 ON했으면 북마크 아이콘을 setImageResource 해서 바꿔주고 싶은데 핸들러에서는
final ImageView Abutton = (ImageView) findViewById(R.id.Abutton);
이게 안되네요..
핸들러에서는 어떻게 설정하나요??
<span style="font-size:10px">public void bookmarkchekchek() {
Cursor cursor1 = db.rawQuery("select book from tb_egdb where num = ?", new String[]{bookcheck});
while (cursor1.moveToNext()) {
bookonoff = cursor1.getString(0);
}
final ImageView Abutton = (ImageView) findViewById(R.id.Abutton);
if(bookonoff.equals("1")){
db.execSQL(" update tb_egdb set book = 0 where num = ?",new String[]{bookcheck}); Toast.makeText(this.activity,"북마크를 해제 하였습니다.",Toast.LENGTH_SHORT).show(); }
else{
db.execSQL(" update tb_egdb set book = 1 where num = ?",new String[]{bookcheck});Toast.makeText(this.activity,"북마크를 적용 하였습니다.",Toast.LENGTH_SHORT).show(); }
}</span>