Ejemplo n.º 1
0
  private Bitmap loadProfileImageWithVCard(String username) {
    Bitmap bitmap = null;
    Log.e(TAG, "Get pic from server");
    VCard vCard = new VCard();
    try {
      vCard.load(JabberConnection.getInstance().getConnection(), username + "@pc-pc");
      byte[] bytes = vCard.getAvatar();
      bitmap = BitmapUtil.getBitmapFromBytes(bytes);

    } catch (SmackException.NoResponseException e) {
      e.printStackTrace();
    } catch (XMPPException.XMPPErrorException e) {
      e.printStackTrace();
    } catch (SmackException.NotConnectedException e) {
      e.printStackTrace();
    }
    return bitmap;
  }