修改poiVideo和道路录像的bug
This commit is contained in:
parent
3b4dd198a0
commit
445aa1ce30
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
// ndkVersion '23.0.7123448'
|
||||
ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -397,21 +397,26 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
// String formatVideoName = formatter.format(calendar.getTime());
|
||||
//文件
|
||||
// String path = finalVideoPath.substring(finalVideoPath.length()-20);
|
||||
File file = new File(finalVideoPath);
|
||||
if (file.exists()) {
|
||||
try {
|
||||
FileOutputStream fo = new FileOutputStream(file);
|
||||
FileDescriptor fileDescriptor = fo.getFD();
|
||||
camera.takeVideo(fileDescriptor);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
if (finalVideoPath!=null){
|
||||
File file = new File(finalVideoPath);
|
||||
if (file.exists()) {
|
||||
try {
|
||||
FileOutputStream fo = new FileOutputStream(file);
|
||||
FileDescriptor fileDescriptor = fo.getFD();
|
||||
camera.takeVideo(fileDescriptor);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
camera.takeVideo(file);
|
||||
}
|
||||
} else {
|
||||
camera.takeVideo(file);
|
||||
}else {
|
||||
Toast.makeText(this, "请录像", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void stopTakenVideo() {
|
||||
|
@ -79,11 +79,11 @@ public class UserApplication extends Application {
|
||||
//builder.cookieJar(new CookieJarImpl(new MemoryCookieStore()));
|
||||
//超时时间设置,默认60秒
|
||||
//全局的读取超时时间
|
||||
builder.readTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS);
|
||||
builder.readTimeout(5000, TimeUnit.MILLISECONDS);
|
||||
//全局的写入超时时间
|
||||
builder.writeTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS);
|
||||
builder.writeTimeout(5000, TimeUnit.MILLISECONDS);
|
||||
//全局的连接超时时间
|
||||
builder.connectTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS);
|
||||
builder.connectTimeout(5000, TimeUnit.MILLISECONDS);
|
||||
OkGo.getInstance().init(this)
|
||||
.setOkHttpClient(builder.build())
|
||||
//全局统一缓存模式,默认不使用缓存,可以不传
|
||||
|
@ -181,15 +181,26 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "对否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
File videoFile = (File) fmPoiVideoPic.getTag();
|
||||
if (videoFile != null) {
|
||||
videoFile.delete();
|
||||
//获取文件名
|
||||
String csvFileName = videoFile.getName() + ".txt";
|
||||
File cavFile = new File(videoFile.getParent(), csvFileName);
|
||||
cavFile.delete();
|
||||
ivPoiVideoPicture.setImageDrawable(null);
|
||||
List<File> videoFiles = (List<File>) fmPoiVideoPic.getTag();
|
||||
if (videoFiles!=null){
|
||||
for (int i = 0; i < videoFiles.size(); i++) {
|
||||
//获取文件名
|
||||
String csvFileName = videoFiles.get(i).getName() + ".txt";
|
||||
File cavFile = new File(videoFiles.get(i).getParent(), csvFileName);
|
||||
videoFiles.clear();
|
||||
cavFile.delete();
|
||||
ivPoiVideoPicture.setImageDrawable(null);
|
||||
}
|
||||
}
|
||||
// File videoFile = (File) fmPoiVideoPic.getTag();
|
||||
// if (videoFile != null) {
|
||||
// videoFile.delete();
|
||||
// //获取文件名
|
||||
// String csvFileName = videoFile.getName() + ".txt";
|
||||
// File cavFile = new File(videoFile.getParent(), csvFileName);
|
||||
// cavFile.delete();
|
||||
// ivPoiVideoPicture.setImageDrawable(null);
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
@ -181,15 +181,25 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "对否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
File videoFile = (File) fmRoadPic.getTag();
|
||||
if (videoFile != null) {
|
||||
videoFile.delete();
|
||||
//获取文件名
|
||||
String csvFileName = videoFile.getName() + ".txt";
|
||||
File cavFile = new File(videoFile.getParent(), csvFileName);
|
||||
cavFile.delete();
|
||||
ivRoadPicture.setImageDrawable(null);
|
||||
}
|
||||
List<File> videoFiles = (List<File>) fmRoadPic.getTag();
|
||||
if (videoFiles!=null){
|
||||
for (int i = 0; i < videoFiles.size(); i++) {
|
||||
String csvFileName = videoFiles.get(i).getName() + ".txt";
|
||||
File cavFile = new File(videoFiles.get(i).getParent(), csvFileName);
|
||||
videoFiles.clear();
|
||||
cavFile.delete();
|
||||
ivRoadPicture.setImageDrawable(null);
|
||||
}
|
||||
}
|
||||
// File videoFile = (File) fmRoadPic.getTag();
|
||||
// if (videoFile != null) {
|
||||
// videoFile.delete();
|
||||
// //获取文件名
|
||||
// String csvFileName = videoFile.getName() + ".txt";
|
||||
// File cavFile = new File(videoFile.getParent(), csvFileName);
|
||||
// cavFile.delete();
|
||||
// ivRoadPicture.setImageDrawable(null);
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user