Open Android Native Player from Fragment -


I am trying to open in a video segment with an audio player, but send me this error

No activity found to handle the intent

Here is the code

  @ Override public view creatives (LayoutInflettter Inflator, View Group Container, Bundle Saved InstantState) {See Routview = Inflator. Float (R. Layout Color, Container, False); ImageButton MBTN = (ImageButton) Routview.FindvibIID (RID.btn1); mBtn.setOnClickListener (New View.OnClickListener) Click on {@Override Public Zero (see V) {Ury Video = Uri.pars ("android.resource: //" + getActivity (). getPackageName () + "/" + R.raw.video_1); intent = new intent (android.content.Intent.ACTION_VIEW, video); getActivity (). StartActivity;}}); Return root view;    

How it is used:

  Public class video player enhances activity activity {@ Override Creates Protected Zero (Bundle Saved InstantState) {super.onCreate (savedInstanceState); SetContentView (R.layout.activity_video_player); FrameLayout Container = Find (VRBID) VVBIID (RIDContainer); Container.setBackgroundColor (Color.BLACK); Watch Video View Video = (Watch Video) Find VVBIID (R.D.VideoVia1); // MediaController MediaController MediaController = create new MediaController (this); MediaController.setAnchorView (videoView); Intent = getIntent (); String path = intent .getStringExtra (Constants.EXTRA_VIDEO_PATH); // Specify the location of the media file // file image fileflowler = new file (getExternalFilesDir (environment. DIRECTORY_PICTURES), constants.APP_FOLDER); //imageFileFolder.mkdir (); // file filefile = new file (image file folder, path //); File file file = new file (path); Uri Uri = Uri.framefile (photofile); // Set up MediaController and URI, then VideoView Video To start the Setimedia Controller (Media Controller); VideoView.setVideoURI (URI); VideoView.requestFocus (); VideoView.start (); }   

I think what is to be done for this, is not possible with its intention.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -