解决数据库更新,修改拍摄视频点击暂停没有返回数据问题
This commit is contained in:
parent
647dd87934
commit
0ee0858a96
@ -119,6 +119,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
return false;
|
||||
}
|
||||
});
|
||||
private int videoIndex;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -352,7 +353,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
// 一段视频拍摄完成自动将当前拍摄路径加1
|
||||
File finalVideoFile = new File(finalVideoPath);
|
||||
if (finalVideoFile.exists()) {
|
||||
int videoIndex = Integer.parseInt(finalVideoFile.getName().replace(".mp4", ""));
|
||||
videoIndex = Integer.parseInt(finalVideoFile.getName().replace(".mp4", ""));
|
||||
finalVideoPath = Objects.requireNonNull(finalVideoFile.getParentFile()).getAbsolutePath() + "/" + (videoIndex + 1) + ".mp4";
|
||||
}
|
||||
}
|
||||
@ -442,7 +443,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
case R.id.btn_stop_video:
|
||||
stopVideoAndFinish();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -451,6 +451,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
if (timerTask != null) {
|
||||
timerTask.cancel();
|
||||
Intent intent = new Intent();
|
||||
File file = new File(finalVideoPath);
|
||||
finalVideoPath = Objects.requireNonNull(file.getParentFile()).getAbsolutePath() + "/" + (videoIndex) + ".mp4";
|
||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalVideoPath);
|
||||
setResult(0x101, intent);
|
||||
} else {
|
||||
|
@ -14,7 +14,7 @@ import com.navinfo.outdoor.util.SdkFolderCreate;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@Database(entities = {PoiEntity.class,ChargingPileEntity.class}, version = 1, exportSchema = false)
|
||||
@Database(entities = {PoiEntity.class,ChargingPileEntity.class}, version = 2, exportSchema = false)
|
||||
public abstract class PoiDatabase extends RoomDatabase {
|
||||
private static final String DB_NAME = "navinfo.db";
|
||||
private static volatile PoiDatabase instance;
|
||||
@ -32,9 +32,7 @@ public abstract class PoiDatabase extends RoomDatabase {
|
||||
}
|
||||
return Room.databaseBuilder(context, PoiDatabase.class, Constant.POI_DAO+DB_NAME)
|
||||
.addMigrations(migration_1_2)
|
||||
.addMigrations(migration_2_3)
|
||||
.addMigrations(migration_3_4)
|
||||
.addMigrations(migration_4_5)
|
||||
//.fallbackToDestructiveMigration()//数据库更新时删除数据重新创建 改动特别大的时候在用
|
||||
.build();
|
||||
}
|
||||
|
||||
@ -42,7 +40,7 @@ public abstract class PoiDatabase extends RoomDatabase {
|
||||
private static Migration migration_1_2 = new Migration(1, 2) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE user ADD certify INTEGER NOT NULL DEFAULT 0");
|
||||
database.execSQL("ALTER TABLE poi ADD COLUMN record_way INTEGER NOT NULL DEFAULT ''");//添加了一个
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -44,7 +44,8 @@ public class PoiEntity implements Serializable {
|
||||
private String dist;//距离用户位置
|
||||
private int taskStatus;//任务状态 0.未领取 1.已领取,5 立即采集,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集)
|
||||
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
|
||||
private int station_type;//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"7 "门牌", "公交:8 情报:9
|
||||
private int station_type;//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 "门牌", "公交:6 情报:7
|
||||
private int isLocalData;//是否是本地数据 0,服务 1,本地
|
||||
private int isExclusive;//任务类型 0.普通任务,1.专属任务
|
||||
private int bodyId;//保存本地的bodyId
|
||||
private int work_type;//0."车行" 1."自行车" 2."步行"
|
||||
@ -98,6 +99,13 @@ public class PoiEntity implements Serializable {
|
||||
this.isExclusive = isExclusive;
|
||||
}
|
||||
|
||||
public int getIsLocalData() {
|
||||
return isLocalData;
|
||||
}
|
||||
|
||||
public void setIsLocalData(int isLocalData) {
|
||||
this.isLocalData = isLocalData;
|
||||
}
|
||||
|
||||
public String getDist() {
|
||||
return dist;
|
||||
|
Loading…
x
Reference in New Issue
Block a user