Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Handler(Looper.myLooper()).post(new Runnable(){
- @Override
- public void run(){
- videoview.setVideoUri("uri");
- }
- });
- public void setVolume(int volume) {
- try {
- audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume, 0);
- ivVoice.setTag(volume != 0);
- updateVoiceImage();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void setVolume(int volume) {
- try {
- //if volume not changed , do nothing.
- if(volume != lastVolume){
- audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,volume,0);
- ivVoice.setTag(volume != 0);
- updateVoiceImage();
- lastVolume = volume;
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
- myVideoView.setVideoURI(Uri.parse(url));
- myVideoView.setMediaController(new MediaController(this));
- myVideoView.requestFocus();
- myVideoView.start();
Add Comment
Please, Sign In to add comment