Displaying existing images in POIDetailActivity

You may have realized from experimenting with POIApp that images only show up after capturing them; if you go back to the list View and select the same POI, the previously captured image will not be displayed. To solve this, we need to add some lines of code to the OnCreate() method to load the image if an ID for a POI was passed in with the intent.

if (Intent.HasExtra ("poiId")) {
    int poiId = Intent.GetIntExtra ("poiId", -1); 
    _poi = POIData.Service.GetPOI (poiId);
    Bitmap poiImage = POIData.GetImageFile (_poi.Id.Value);
    _poiImageView.SetImageBitmap (poiImage);
    if (poiImage != null)
      poiImage.Dispose ();
  }
  else
    _poi = new PointOfInterest ();
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.8.82