maybe try your intent this way:

        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.parse(url), "video/mp4");
        view.getContext().startActivity(intent);





On Aug 2, 4:58 pm, Kyle <kyle4...@gmail.com> wrote:
> Here is my code that I'm currently using:
>         final class MyWebViewClient extends WebViewClient {
>             @Override
>             public boolean shouldOverrideUrlLoading(WebView view, String
> url) {
>                 if (url.endsWith(".mp4"))  {
>                     Intent intent = new
> Intent("android.intent.action.VIEW", Uri.parse(url));
>                     view.getContext().startActivity(intent);
>                     return true;
>                 } else {
>                     return super.shouldOverrideUrlLoading(view, url);
>                 }
>             }
>         }
>
> On Aug 2, 3:00 pm, Matty <busbus...@gmail.com> wrote:
>
> > Are you calling intent.setDataAndType(Uri Data, String Type)
> > ?
>
> > Sometimes specifying the right mime type makes a big difference.
>
> > On Aug 2, 1:26 am, Kyle <kyle4...@gmail.com> wrote:
>
> > > Hey,
> > > I've created a WebView which loads a webpage and will play any file
> > > that ends in mp4 on click. The problem is, is that when the
> > > application is loaded on Android 2.2 and I click a mp4 link, it will
> > > open the web browser and immediately close. I can take that same link
> > > and manually enter it into the web browser and the media player will
> > > launch and play the file properly. What I'm wondering is how can I get
> > > my application to properly load the media player and play the video?
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to