Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm implementing a videview in my android app but after doing the required imports im still getting this error on my code:

Java
VideoView cannot be resolved or is not a field


This is the class where videoview is implemented:

Java
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.widget.VideoView;

public class StudentLife extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_student_life);
		
		VideoView videoview = (VideoView) findViewById(R.id.VideoView);

		Uri uri = Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.learningatgmit);

		videoview.setVideoURI(uri);
		videoview.start();
		
		
		
	
	}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900