VideoView onClickListener not working

All your problems with Audio, Video and Images.

VideoView onClickListener not working

Postby afzkl » Thu Nov 19, 2009 9:34 pm

Hi, im facing a small problem with a VideoView and onClickListener. I can't get it to registrer my clicks on the view. Am I doing something wrong or is it just not possible this way? Exemplecode below.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. setContentView(R.layout.videoview);
  3.  
  4.        
  5.  
  6. mVideoView = (VideoView) findViewById(R.id.video);
  7.  
  8.        
  9.  
  10.  
  11.  
  12.  
  13.  
  14. mVideoView.setVideoPath(path);
  15.  
  16. mVideoView.requestFocus();
  17.  
  18. mVideoView.start();
  19.  
  20. mVideoView.setOnClickListener(new View.OnClickListener() {
  21.  
  22.                                
  23.  
  24.         @Override
  25.  
  26.         public void onClick(View v) {
  27.  
  28.  
  29.  
  30.                                        
  31.  
  32.                 mVideoView.pause();
  33.  
  34.                                        
  35.  
  36.         }
  37.  
  38. });
Parsed in 0.032 seconds, using GeSHi 1.0.8.4

Is there any other solution to this problem?
Thanks in advance!
afzkl
Freshman
Freshman
 
Posts: 2
Joined: Thu Oct 01, 2009 4:10 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Exabot [Bot] and 18 guests