@Override protected boolean onBalloonTap(int index, CustomOverlayItem item) { Intent intent = null; if (item.getUserID() != Utility.getInstance().userInfo.getId()) { // Move to the user's profile intent = new Intent().setClass(c, FriendProfileActivity.class); intent.putExtra("userID", item.getUserID()); c.startActivity(intent); } else c.startActivity( new Intent(c, FriendizerActivity.class) .putExtra("tab", R.string.my_profile) .setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NO_ANIMATION)); return true; }
@Override protected void setBalloonData(CustomOverlayItem item, ViewGroup parent) { // map our custom item data to fields title.setText(item.getTitle()); snippet.setText(item.getSnippet()); // get remote image from network. // bitmap results would normally be cached, but this is good enough for // demo purpose. image.setImageResource(R.drawable.icon); new FetchImageTask() { protected void onPostExecute(Bitmap result) { if (result != null) { image.setImageBitmap(result); } } }.execute(item.getMapArgument().getPoi().getIcon()); }