android - Pass an Image from Activity to Adapter Class -


i trying pass image singleitem activity cartadapter, facing problem, while trying pass item image.

i want whenever user click on add cart button in singleitem activity, need send item image , strings singleitem.java cartadapter.java

note: able pass string trying pass item image, missing code onbuttonclick in singleitem.java

like using below line getting value item title

     mytitle = txttitle.gettext().tostring();  log.d(singleitem.log_tag, "title :: " + mytitle); 

but don't know how item image

    mythumb = // here should need write 

see code below:

singleitem.java::

                                // below need                                                                 mythumb = // here want write code image,                                           // above have written code string 

bitmap class implements parcelable can pass bitmap 1 class class not recommend this. in experience in case of large bitmaps, cause anr in android, can use singleton pattern interclass communication heavy objects, if using singleton make sure read multithreading issues.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -