Android アプリを実装しようとしています。メイン アクティビティでは Google マップを表示しています。また、同じレイアウトでビデオ ビューを実装しようとしています。そのため、メインマップアクティビティ(マップが表示されている間)で、マップビューの下で(記録を行うために)ビデオビューアクティビティを同時に呼び出すスレッドを実装しようとしています。
これは可能ですか?エラーが多いので。誰か助けてください..?ありがとう
public class MainActivity extends MapActivity implement Runnable{
private MapView mapView;
private MyLocationOverlay myLocationOverlay;
private Button playerbtn;//button to start player
private Button recorderbtn;//button for recorder
private VideoView mVideoView;
private Uri mVideoUri;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mVideoView = (VideoView) findViewById(R.id.videoview);
playerbtn= (Button)findViewById(R.id.playback);
recorderbtn = (Button)findViewById(R.id.recording);
// main.xml contains a MapView
setContentView(R.layout.main);
// extract MapView from layout
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
// create an overlay that shows our current location
myLocationOverlay = new FixedMyLocationOverlay(this, mapView);
// add this overlay to the MapView and refresh it
mapView.getOverlays().add(myLocationOverlay);
mapView.postInvalidate();
// call convenience method that zooms map on our location
zoomToMyLocation();
}
//--videoview
public void recordingListner(View view) {
Thread toRun = new Thread()
{
public void run()
{
final Intent intent = new Intent(MainActivity.this, VideoRecorder.class);
handleCameraVideo(intent);
startActivity(intent);
}
};
toRun.start();
}
private void handleCameraVideo(Intent intent) {
mVideoUri = intent.getData();
mVideoView.setVideoURI(mVideoUri);
mVideoView.setVisibility(View.VISIBLE);
}