0
我添加了一個視頻視圖到其中一個應用程序頁面,當我嘗試通過執行R.id.videoview來識別它時).id無法解析。有人可以幫幫我嗎?R.id沒有解決
package jslsoftware.com;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.VideoView;
import android.widget.MediaController;
public class TestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Uri vidFile = Uri.parse("http://jslserver1.yolasite.com/resources/3gp_videos/Animal.3gp");
VideoView videoView = (VideoView) findViewById(R.id.VideoView)
videoView.setVideoURI(vidFile);
videoView.setMediaController(new MediaController(this));
videoView.start();
}
}
是吧' R.id'沒有解決,或者R.id.VideoView? – 2012-04-09 23:01:35
是否向視圖添加了android:id標記? – Benoir 2012-04-09 23:04:28
包括jslsoftware.com.R並且它會解決。 – kodeshpa 2012-04-09 23:09:25