title: Redirect Uri not opening the Android App directly in OAuth2 - Deep link is already configured
body: <p>Requirement:  To open a URL and get the response back to the application and redirect the user back to my app since there are other API calls that follow.</p>
  
  <pre><code>&lt;intent-filter
              android:autoVerify="true"
              android:order="1"&gt;
              &lt;action android:name="android.intent.action.VIEW" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
  
              &lt;data
                  android:host="ab.bc.cd"
                 android:port="11001"/&gt;
                 &lt;data android:scheme="https" /&gt;
                  &lt;data android:scheme="http" /&gt;
                 &lt;data android:pathPrefix="/abc.html" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <blockquote>
    <p>Code to open the first api call in the browser:</p>
  </blockquote>
  
  <pre><code>if (!TextUtils.isEmpty(url)) {
          final CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder().build();
          CustomTabActivityHelper.openCustomTab(MainActivity.this, customTabsIntent, Uri.parse(url), new WebviewFallback() {
              @Override
              public void openUri(Activity activity, Uri uri) {
                      setupCustomTabs(uri);
              }
          });
  </code></pre>
  
  <blockquote>
    <p>Handling the Intent part here</p>
  </blockquote>
  
  <pre><code>  protected void onNewIntent(Intent intent) {
      super.onNewIntent(intent);
      final String schemeName = intent.getScheme();
      final Uri data = intent.getData();
      if (data != null &amp;&amp; data.getHost() != null &amp;&amp; data.getHost().equalsIgnoreCase("")) {
          return;
      }
      if (!TextUtils.isEmpty(schemeName) &amp;&amp; schemeName.equalsIgnoreCase(UAEPassConstant.SCHEME)) {
          final Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
          if (fragment != null &amp;&amp; !(fragment instanceof DisplayFragment)) {
              setFragment(new DisplayFragment(), null, false);
          }
          final String encodedQuery = intent.getData().getEncodedQuery();
          if (!TextUtils.isEmpty(encodedQuery) &amp;&amp; !encodedQuery.contains(UAEPassConstant.ERROR_DESCRIPTION)) {
              final String[] queryDataArray = encodedQuery.split("=|&amp;"); // this is to fetch a code value which comes as a result of the first api call
              final LoginApiCall uaePassCall = new LoginApiCall(MainActivity.this, queryDataArray[1], new IUAEPassCallBack() {
                  @Override
                  public void onSuccessLogin(String userInfoJson, String tokenJson) {
                      Log.e("userInfo", userInfoJson);
                      Log.e("tokenJson", tokenJson);
                      final Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
                      if (fragment instanceof DisplayFragment) {
                          ((DisplayFragment) fragment).LoggingData(userInfoJson);
  
                      }
                  }
  </code></pre>
  
  <p><strong>What happens</strong>: When I run this code everything works but when the first API call link opens in the browser and when I approve the login request for it, it shows the redirect URI in the browser itself and the control does not directly come back to my app. Instead, it freezes and then I need to click on "Open in chrome" (attached) and then it gives me a prompt whether I would like to open the app and on selecting that the control goes back to my app. Any pointers will be appreciated. Thanks in Advance!
  Edit: the code works properly during the first execution but second time I get this issue. </p>