Reputation: 1736
I am trying to use YouTubeStandalonePlayer from https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubeStandalonePlayer
With this code inside onCreate()
:
Intent intent = YouTubeStandalonePlayer.createVideoIntent(this, DeveloperKey.DEVELOPER_KEY, VIDEO_ID);
startActivity(intent);
But application fails with error.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.youtubestandalone/com.example.youtubestandalone.MainActivity}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.google.android.youtube.api.StandalonePlayerActivity.START (has extras) }
How to fix this?
Upvotes: 0
Views: 3505
Reputation: 11
Check if you have include the jar file in your project. Make sure you have done the follow steps.
Good luck!
Upvotes: 1
Reputation: 28484
Add this line to your AndroidManifest.xml
<activity
android:name="com.google.android.youtube.api.StandalonePlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
/>
Upvotes: 2