android - How to compare Between Image Value and String -


im new on android studio,ihve value data tht intent

integer resourceid = (integer)g.getitematposition(item.getitemid());  intent k = new intent(mainactivity.this,imagedetail.class); k.putextra("id",resourceid); startactivity(k); 

on receiver

linearlayout linearlayout = new linearlayout(this); setcontentview(linearlayout); linearlayout.setorientation(linearlayout.vertical); intent k =getintent(); textview textview = new textview(this); textview.settext(k.getextras().getint("id")); linearlayout.addview(textview); 

(i got value "res/drawable/ikan.jpg")

when try compare textview , string fail...

 if (textview.equals("res/drawable/ikan.jpg")){       //kondisi    } 

you should like:

 if (textview.gettext().tostring().equals("res/drawable/ikan.jpg")){       //kondisi    } 

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -