我的Android Studio工作正常,直到早上,但是今晚我收到错误说"Gradle sync failed:Connection timed out:connect.如果你在HTTP代理后面,请在IDE或Gradle中配置代理设置." 我没有使用任何代理服务器.甚至HTTP代理的选项也设置为"无代理".我不知道如何让这个工作.我尝试在防火墙中公开访问Android Studio但它没有用.
欢迎任何帮助/解决方案.
PS我的Android Studio版本是2.2.3
谢谢!
我正在制作一个自定义视频播放器,我成功地将视频的进度同步到了seekbak.我希望当用户移动搜索栏处理程序时,videoview应该将其进度与搜索栏的进度同步.我也实现了这一点,但它并不像我想要的那样表现.让我详细说明这个问题,当我触摸搜索栏处理程序并向前移动(向前或向后)时,我更新搜索栏进度,但当我离开搜索栏时,搜索栏处理程序向前/向后一步然后开始播放而不是从我离开时的同一点.
这是我的代码:
public class MainActivity extends Activity implements OnSeekBarChangeListener {
private VideoView vvVideo;
private SeekBar sbVideo;
private Handler mHandler = new Handler();
private Utilities utils;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.custom_video_player);
initOnjects();
playVideo();
}
private void initOnjects() {
vvVideo = (VideoView) findViewById(R.id.vvVideo);
sbVideo = (SeekBar) findViewById(R.id.sbVideo);
sbVideo.setOnSeekBarChangeListener(this);
utils = new Utilities();
}
private void playVideo() {
Uri uri = Uri
.parse("android.resource://com.sunshine.handsonequation/raw/title_video");
vvVideo.setVideoURI(uri);
sbVideo.setProgress(0);
sbVideo.setMax(100);
vvVideo.start();
// Updating progress bar
updateProgressBar();
}
private void updateProgressBar() {
mHandler.postDelayed(updateTimeTask, 100);
} …Run Code Online (Sandbox Code Playgroud)