【问题标题】:android - detect a touch on the screen while video is runningandroid - 在视频运行时检测屏幕上的触摸
【发布时间】:2010-11-18 14:41:58
【问题描述】:

我是初学者,我有两个问题。

  1. 为什么附加代码中的视频没有运行(从模拟器中获取应用程序无法运行视频的消息)。

  2. 谁能帮我理解我应该如何实现 onTouchEvent 以便在视频运行时捕获屏幕上的触摸(不在乎屏幕上的哪个位置)。

    李>

提前致谢 阿米海

公共类 VidShow 扩展 Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videoscrn);

/*run the video*/
VideoView video = (VideoView) findViewById(R.id.video);

// Load and start the movie
video.setVideoPath("raw/samplevideo.3gp" );
video.start();

}

}

【问题讨论】:

    标签: android video touch-event


    【解决方案1】:

    扩展VideoView并实现VideoView.onTouchEvent(..)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多