private Profile getPreviouslySelectedProfile() {
   Profile previous = null;
   SharedPreferences prefs = getSharedPreferences(PREFS_NAME, 0);
   String uuid = prefs.getString(PREFS_PREVIOUS_PROFILE, null);
   if (uuid != null) {
     previous = mProfileManager.getProfile(UUID.fromString(uuid));
   }
   return previous;
 }
  private void switchTo(UUID uuid) {
    Profile p = mProfileManager.getProfile(uuid);
    if (p != null) {
      mProfileManager.setActiveProfile(uuid);

      Toast.makeText(
              this,
              String.format(getResources().getString(R.string.profile_selected), p.getName()),
              Toast.LENGTH_LONG)
          .show();
      NFCProfileUtils.vibrate(this);
    }
  }