package me.id.webverifylib;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.support.customtabs.CustomTabsIntent;

import me.id.webverifylib.exception.UserCanceledException;
import me.id.webverifylib.helper.CustomTabsHelper;

public class IDmeCustomTabsActivity extends Activity {
  public static final String EXTRA_URL = "url";

  private boolean shouldCloseCustomTab = true;
  protected String url;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    url = getIntent().getStringExtra(EXTRA_URL);

    if (savedInstanceState == null) {
      shouldCloseCustomTab = false;
      try {
        CustomTabsHelper.getCustomTabIntent(this, url)
            .launchUrl(this, Uri.parse(url));
      } catch (ActivityNotFoundException exception) {
        IDmeWebVerify.getInstance().notifyFailure(
            new ActivityNotFoundException("There isn't a available browser to handle the ID.me oauth flow")
        );
        finish();
      }
    }
  }

  @Override
  protected void onResume() {
    super.onResume();
    if (shouldCloseCustomTab) {
      if (IDmeWebVerify.getCurrentState() != null) {
        IDmeWebVerify.getInstance().notifyFailure(new UserCanceledException());
      }
      finish();
    }
    shouldCloseCustomTab = true;
  }
}

@@ -154,60 +154,8 @@
 dle;
-%0Aimport android.support.customtabs.CustomTabsIntent;
 %0A%0Aim
@@ -944,16 +944,17 @@
  isn't a
+n
  availab

Fix a typo