Note that there are some explanatory texts on larger screens.

plurals
  1. POApp crashing when trying to use VideoView
    primarykey
    data
    text
    <p>I just started messing with android dev and I am trying to simply play a video file that is on the web somewhere. My Main.xml looks like this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;Button android:layout_height="wrap_content" android:id="@+id/button1" android:layout_width="wrap_content" android:text="@string/buttonText" android:onClick="clickHandler"&gt;&lt;/Button&gt; &lt;VideoView android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/MyVideoView"&gt;&lt;/VideoView&gt; &lt;/LinearLayout&gt; </code></pre> <p>and my java file looks like this: package com.dop.videoTest;</p> <pre><code>import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.MediaController; import android.widget.Toast; import android.widget.VideoView; public class VideoTest extends Activity { private String path = "http://commonsware.com/misc/test2.3gp"; private VideoView mVideoView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void clickHandler(View view) { mVideoView = (VideoView) findViewById(R.id.MyVideoView); if (path == "") { Toast.makeText( VideoTest.this, "Please edit VideoViewDemo Activity, and set path" + " variable to your media file URL/path", Toast.LENGTH_LONG).show(); } else { mVideoView.setVideoPath(path); mVideoView.setMediaController(new MediaController(this)); mVideoView.requestFocus(); } } } </code></pre> <p>so when I click my button, it just says "The application Video Test has stopped unexpectedly. Please Try Again."</p> <p>any idea?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload