Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28474

How to find custom button in custom UI layout in exoplayer?

$
0
0

I want to custom the UI of exoplayer using these codes

<com.google.android.exoplayer2.ui.PlayerView
    android:id="@+id/exoplayer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:controller_layout_id="@layout/control_view_normal"/>

This is control_view_normal,corresponding to the app:controller_layout_id

Then I try to find the exo_fullscreen_button in the code

 View controlView = videoView.findViewById(R.id.exo_controller);
 controlView.findViewById(R.id.exo_fullscreen_button)  
            .setOnClickListener(v -> {           //null pointer exception! why?
                    ((Activity)context).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
                });

Moreover,the compiler gives me a controlView.findViewById(R.id.exo_fullscreen_button) is null pointer. Someone know how should I find the custom button in the custom layout?


Viewing all articles
Browse latest Browse all 28474

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>