@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getSupportActionBar().setDisplayShowHomeEnabled(false);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setDisplayShowCustomEnabled(false);
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    getSupportActionBar().setTitle(null);

    uid = getIntent().getIntExtra(Intents.EXTRA_UID, 0);
    try {
      if (uid == 0)
        uid = Integer.parseInt(getIntent().getData().getPath().replace(")", "").split("/")[2]);
      users().get(uid);
    } catch (Exception e) {
      Toast.makeText(this, getString(R.string.profile_cant_find_user), Toast.LENGTH_SHORT).show();
      finish();
      return;
    }

    if (savedInstanceState == null) {
      ProfileFragment fragment;
      BaseActorProfileActivity profileIntent =
          ActorSDK.sharedActor().getDelegate().getProfileIntent();
      if (profileIntent != null) {
        fragment = profileIntent.getProfileFragment(uid);
      } else {
        fragment = ProfileFragment.create(uid);
      }

      showFragment(fragment, false, false);
    }
  }
 @Override
 protected void onResume() {
   super.onResume();
   bind(
       users().get(uid).isContact(),
       new ValueChangedListener<Boolean>() {
         @Override
         public void onChanged(Boolean val, Value<Boolean> Value) {
           invalidateOptionsMenu();
         }
       });
   messenger().onProfileOpen(uid);
 }
 @Override
 protected void onPause() {
   super.onPause();
   messenger().onProfileClosed(uid);
 }