Adding a subview in java

Adding a subview in java
0.0 0



I’m trying to add a video view in the center of the screen by calling through JNI.
Now I already added a new method into the Cocos2dxActivity, and can call this function from the c file.

I have googles a bit and found this piece of codes,

mVideoView = (VideoView)activity.findViewById(;
mVideoView.setVideoURI(Uri.parse(“android.resource://” + activity.getPackageName() *“/”*R.raw.lesson1_intro));
mVideoView.setMediaController(new MediaController(activity));

this codes can be run properly on the normal android application; however, when I put into the new class and call it from the Cocos2dx, there are errors shown.

Anyone please suggest me how can I add this video view into my project.