view - Marker with Profile Image -


i want show marker image of profile picture using picasso library.

i can't determine how. userprofilepicture url of profile picture of user, , storing on userprofilepicturereceived.

public class googlemaps extends activity implements onmapreadycallback {     protected googlemap map;     protected string usernamereceived;     protected string userprofilepicturereceived;     protected bitmap bmp;     protected bitmapdescriptor icon;     protected canvas canvas1;     protected imageview icon2;      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.fragment_maps);         mapfragment mapfragment = (mapfragment) getfragmentmanager().findfragmentbyid(r.id.map);         mapfragment.getmapasync(this);          usernamereceived = mainactivity.username;//using global variable username mainactivity class         userprofilepicturereceived = mainactivity.userprofilepicture;        // icon2 = (imageview) findviewbyid(r.id.imageview2);         icon2.draw(canvas1);            bitmap.config conf = bitmap.config.argb_8888;         bmp = bitmap.createbitmap(80, 80, conf);         canvas1 = new canvas(bmp);      }       @override     protected void onrestart() {         super.onrestart();     }      @override     protected void onstart() {         picasso.with(googlemaps.this)                 .load(userprofilepicturereceived)                 .resize(100, 100)                 .config(bitmap.config.argb_4444)                         //  .error(r.drawable.abc_btn_radio_to_on_mtrl_015)  // en caso de no tener imagen pone una predeterminada                 .transform(new roundedtransformation(50, 4))                 .into(icon2);          icon2.draw(canvas1);        // bitmapdrawable drawable = (bitmapdrawable) icon2.getdrawable();         //userpictureasgeopoint = drawable.getbitmap();         //icon = bitmapdescriptorfactory.frombitmap(userpictureasgeopoint);         super.onstart();     }      @override     protected void onresume() {         super.onresume();     }      @override     protected void onpause() {         super.onpause();     }      @override protected void onstop() {     super.onstop(); }      @override     protected void ondestroy() {         super.ondestroy();     }      @override     public void onmapready(googlemap map) {         map.addmarker(new markeroptions()                 .position(new latlng(10, 10))                 .title(usernamereceived))                 .seticon(bitmapdescriptorfactory.frombitmap(bmp));           //marker.showinfowindow         //marker.showinfowindow         //setvisibility     } } 


Popular posts from this blog