title: Error loading youtube video: Unknown youtube Activity
body: <p>The part of my code using onClick Listener is not resonponding neither playing any video.</p>
  <pre><code>
  public class MainActivity extends AppCompatActivity {
      private AdView mAdView;
      private AdView mAdView2;
      private static final String TAG = MainActivity.class.getSimpleName();
      private RecyclerView firstrecyclerView;
  
      ArrayList&lt;VideoDetails&gt; videoDetailsoArrayList;
      String API_Key = &quot;myKey`&quot;;
      String url = &quot;https://www.googleapis.com/youtube/v3/search?part=snippet&amp;channelId=UCVMWWQ985A_-SESZUy_SsVQ&amp;maxResults=50&amp;key=myKey&quot;;
      adapter adapter;
      VideoDetails videoDetails;
  
      private YouTubePlayerSupportFragmentX youTubePlayerFragment;
      //youtube player to play video when new video selected
      private YouTubePlayer youTubePlayer;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          initializeYoutubePlayer();
          setUpRecyclerView();
          populateRecyclerView();
          MobileAds.initialize(this, new OnInitializationCompleteListener() {
              @Override
              public void onInitializationComplete(InitializationStatus initializationStatus) {
              }
          });
  
          mAdView = findViewById(R.id.adView);
          AdRequest adRequest = new AdRequest.Builder().build();
          mAdView.loadAd(adRequest);
          mAdView2 = findViewById(R.id.adView2);
          AdRequest adRequest2 = new AdRequest.Builder().build();
          mAdView2.loadAd(adRequest2);
      }
      private void setUpRecyclerView() {
          firstrecyclerView = findViewById(R.id.first_recycler_view);
          firstrecyclerView.setHasFixedSize(true);
          videoDetailsoArrayList = new ArrayList&lt;&gt;();
          displayVideos();
  
      }
  
      private void displayVideos() {
          RequestQueue requestQueue = Volley.newRequestQueue(this);
          StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String response) {
                  try {
                      JSONObject jsonObject = new JSONObject(response);
                      JSONArray jsonArray = jsonObject.getJSONArray(&quot;items&quot;);
                      for (int i = 0; i &lt; jsonArray.length(); i++) {
                          JSONObject jsonObject1 = jsonArray.getJSONObject(i);
                          if (jsonObject1.has(&quot;id&quot;)) {
                              JSONObject jsonVideoId = jsonObject1.getJSONObject(&quot;id&quot;);
                              if (jsonVideoId.has(&quot;kind&quot;)) {
                                  if (jsonVideoId.getString(&quot;kind&quot;).equals(&quot;youtube#video&quot;)) {
                                      JSONObject jsonObjectSnippet = jsonObject1.getJSONObject(&quot;snippet&quot;);
                                      JSONObject jsonObjectDefault = jsonObjectSnippet.getJSONObject(&quot;thumbnails&quot;).getJSONObject(&quot;medium&quot;);
                                      String video_id = jsonVideoId.getString(&quot;videoId&quot;);
                                      VideoDetails vd = new VideoDetails();
                                      vd.setVideoId(video_id);
                                      vd.setTitle(jsonObjectSnippet.getString(&quot;title&quot;));
                                      vd.setDescription(jsonObjectSnippet.getString(&quot;description&quot;));
                                      vd.setUrl(jsonObjectDefault.getString(&quot;url&quot;));
                                      videoDetailsoArrayList.add(vd);
                                  }
                              }
                          }
                      }
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
                  firstrecyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
                  firstrecyclerView.addItemDecoration(new DividerItemDecoration(getApplicationContext(), LinearLayoutManager.VERTICAL));
                  adapter = new adapter(getApplicationContext(), videoDetailsoArrayList);
                  firstrecyclerView.setAdapter(adapter);
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  Toast.makeText(getApplicationContext(), error.getMessage(), LENGTH_LONG).show();
              }
          });
          requestQueue.add(stringRequest);
      }
  
      private void initializeYoutubePlayer() {
          youTubePlayerFragment=(YouTubePlayerSupportFragmentX) getSupportFragmentManager().findFragmentById(R.id.youtube_player_fragment);
          if (youTubePlayerFragment == null)
              return;
          youTubePlayerFragment.initialize(API_Key, new YouTubePlayer.OnInitializedListener() {
              @Override
              public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player, boolean wasRestored) {
                  if (!wasRestored) {
                      youTubePlayer = player;
                      //set the player style default
                      youTubePlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);
                      //set the player style default
                      youTubePlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);
                      //cue the 1st video by default
                     // youTubePlayer.cueVideo(String.valueOf(videoDetailsoArrayList.get(0)));
                      youTubePlayer.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE);
  
                  }
  
              }
  
              @Override
              public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
                  //print or show error if initialization failed
                  Log.e(TAG, &quot;Youtube Player View initialization failed&quot;);
              }
          });
      }
      //POPULATE RECYCLER VIEW
      private void populateRecyclerView() {
          final adapter adapter = new adapter(this, videoDetailsoArrayList);
          firstrecyclerView.setAdapter(adapter);
          //set click event
          firstrecyclerView.addOnItemTouchListener(new RecyclerViewOnClickListener(this, new RecyclerViewOnClickListener.OnItemClickListener() {
              @Override
              public void onItemClick(View view, int position) {
                  if (youTubePlayerFragment != null &amp;&amp; youTubePlayer != null) {
                      //update selected position
                      adapter.setSelectedPosition(position);
  
                      //load selected video
                      youTubePlayer.loadVideo(String.valueOf(videoDetailsoArrayList.get(position)));
                      // youTubePlayer.loadVideo(videoDetails.get(position)));
                  }
  
              }
          }));
      }
  }
  
  
  </code></pre>
  <p>while the error in error logCat is here</p>
  <pre><code>2020-09-12 05:19:31.600 28102-28102/? E/Zygote: isWhitelistProcess - Process is Whitelisted
  2020-09-12 05:19:38.374 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:38.582 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:38.609 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:38.677 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:38.801 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:38.823 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatImageView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:38.839 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatImageView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:38.941 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.007 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatImageView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.015 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.043 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.050 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatImageView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.090 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.200 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.223 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.232 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.261 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatImageView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.270 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatImageView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.278 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.312 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:39.362 28102-28102/com.currentmedia.wasifaliwasif E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
  2020-09-12 05:19:42.477 28102-28295/com.currentmedia.wasifaliwasif E/YouTubeAndroidPlayerAPI: Embed config is not supported in RemoteEmbeddedPlayer.
  2020-09-12 05:19:43.145 28102-28271/com.currentmedia.wasifaliwasif E/YouTubeAndroidPlayerAPI: Embed config is not supported in RemoteEmbeddedPlayer.
  2020-09-12 05:19:45.038 28102-28271/com.currentmedia.wasifaliwasif E/YouTubeAndroidPlayerAPI: Embed config is not supported in RemoteEmbeddedPlayer.
  </code></pre>
  <p>I have tried changing the Apptheme with Base.AppTheme as described in a stackover answer but it didnot work. the app is displaying Youtube fragment, recyclerview with thumbnails and title but not responding to click event.</p>