Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bitmap bmImg = imageLoader.loadImageSync(url);
- 04-13 14:11:44.953: E/ImageLoader(18542): android.os.NetworkOnMainThreadException
- public void drawPicsOnMap()
- {
- String title = null;
- String place = null;
- for (int i = 0; i<camera.size(); i++)
- {
- Bitmap.Config conf = Bitmap.Config.ARGB_8888;
- Bitmap bmp = Bitmap.createBitmap(80, 80, conf);
- Canvas canvas = new Canvas(bmp);
- // paint defines the text color,
- // stroke width, size
- Paint color = new Paint();
- color.setTextSize(35);
- color.setColor(Color.BLACK);
- Camera cam = camera.get(i);
- LatLng coord = new LatLng(cam.lat, cam.lon);
- title = Integer.toString(cam.id);
- place = cam.place;
- String url = cam.img;
- Bitmap bmImg = imageLoader.loadImageSync(url);
- //modify canvas
- canvas.drawBitmap(bmImg, 0,0, color);
- canvas.drawText(title, 30, 40, color);
- Marker mark = map.addMarker(new MarkerOptions()
- .position(coord)
- .title(title)
- .snippet(place)
- .icon(BitmapDescriptorFactory
- .fromBitmap(bmp)));
- markers.put(mark.getId(), url);
- }
- }
- imageLoader.loadImage(url, new SimpleImageLoadingListener(){
- @Override
- public void onLoadingComplete(String imageUri, View view,
- Bitmap loadedImage) {
- super.onLoadingComplete(imageUri, view, loadedImage);
- //write your code here to use loadedImage
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement