How to capture click event on VideoView

All your problems with Audio, Video and Images.

How to capture click event on VideoView

Postby cold_blood_boy178 » Sat Oct 02, 2010 4:53 pm

I want to capture the click event on VideoView. I followed the same
steps with Button. However, it does not work. Could you give me a
recommendation? This is my code.
public class Hello extends Activity implements OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView video_up = (VideoView) findViewById(R.id.video_up);
View continueButton = findViewById(R.id.continue_button);
continueButton.setOnClickListener(this);
video_up.setVideoPath("/data/3.3gp");
video_up.start();
video_up.setOnClickListener(this);
}
// ...
public void onClick(View v) {
Log.d("ID_EVENT_TRUONG",Integer.toString(v.getId()));
switch (v.getId()) {
case R.id.continue_button:
new AlertDialog.Builder(this)
.setTitle("BrightHub Alert!")
.setMessage("Google Android How-to guides in the Bright Hub")
.setNeutralButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
}
}).show();
break;
// More buttons go here (if any) ...
case R.id.video_up:
new AlertDialog.Builder(this)
.setTitle("BrightHub Alert!")
.setMessage("Google Android How-to guides in the Bright Hub")
.setNeutralButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
}
}).show();
break;
}
}
}
cold_blood_boy178
Freshman
Freshman
 
Posts: 3
Joined: Sat Oct 02, 2010 4:48 pm

Top

Re: How to capture click event on VideoView

Postby cold_blood_boy178 » Mon Oct 04, 2010 5:15 am

No one can answer my question?
cold_blood_boy178
Freshman
Freshman
 
Posts: 3
Joined: Sat Oct 02, 2010 4:48 pm

Re: How to capture click event on VideoView

Postby cold_blood_boy178 » Tue Oct 05, 2010 10:46 am

I solved this problem. Actually, I cannot capture the click event with VideoView class. However, I used Surface View to show video instead of VideoView. With Surface View, I captured the click event successfully. Anyway, thanks everyone for reading my problem.
cold_blood_boy178
Freshman
Freshman
 
Posts: 3
Joined: Sat Oct 02, 2010 4:48 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: TurnitinBot [Bot] and 13 guests