Exemplo n.º 1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.view_checkins);

    mapView = (MapView) findViewById(R.id.loc_map);
    image = (ImageView) findViewById(R.id.checkin_img);
    photo = (TextView) findViewById(R.id.checkin_photo);
    photoLayout = (LinearLayout) findViewById(R.id.img_layout);
    photoLayout.setVisibility(View.GONE);
    Bundle incidents = getIntent().getExtras();
    photo.setVisibility(View.GONE);
    extras = incidents.getBundle("checkins");
    photosBundle = new Bundle();
    checkinLatitude = extras.getString("latitude");
    checkinLongitude = extras.getString("longitude");
    activityTitle = (TextView) findViewById(R.id.title_text);
    if (activityTitle != null) activityTitle.setText(getTitle());
    name = (TextView) findViewById(R.id.checkin_title);
    name.setTextColor(Color.BLACK);
    name.setText(extras.getString("name"));

    date = (TextView) findViewById(R.id.date);
    date.setTextColor(Color.BLACK);
    date.setText(extras.getString("date"));

    message = (TextView) findViewById(R.id.checkin_description);
    message.setTextColor(Color.BLACK);
    message.setText(extras.getString("message"));

    fileName = extras.getString("photo");
    if (!TextUtils.isEmpty(fileName)) {
      photoLayout.setVisibility(View.VISIBLE);
      photo.setVisibility(View.VISIBLE);
      image.setImageDrawable(ImageManager.getImages(UshahidiPref.savePath, fileName));
    }

    mapController = mapView.getController();
    defaultLocation =
        getPoint(Double.parseDouble(checkinLatitude), Double.parseDouble(checkinLongitude));
    centerLocation(defaultLocation);
  }