Fix export
This commit is contained in:
parent
33bfb87d26
commit
d4c3ffed58
|
@ -93,7 +93,7 @@ dependencies {
|
||||||
implementation 'org.apache.poi:poi:3.16'
|
implementation 'org.apache.poi:poi:3.16'
|
||||||
implementation 'com.github.mabbas007:TagsEditText:1.0.5'
|
implementation 'com.github.mabbas007:TagsEditText:1.0.5'
|
||||||
implementation 'com.jaredrummler:material-spinner:1.3.1'
|
implementation 'com.jaredrummler:material-spinner:1.3.1'
|
||||||
implementation 'com.github.stom79:SQLite2XL:1.0.5'
|
implementation 'com.github.stom79:SQLite2XL:1.2'
|
||||||
implementation "com.tonyodev.fetch2:fetch2:2.3.6"
|
implementation "com.tonyodev.fetch2:fetch2:2.3.6"
|
||||||
playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion"
|
playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1437,6 +1437,9 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
SQLiteToExcel sqliteToExcel = new SQLiteToExcel(BaseMainActivity.this, DB_NAME);
|
SQLiteToExcel sqliteToExcel = new SQLiteToExcel(BaseMainActivity.this, DB_NAME);
|
||||||
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date());
|
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date());
|
||||||
final String fileName = "Mastalab_export_"+timeStamp+".xls";
|
final String fileName = "Mastalab_export_"+timeStamp+".xls";
|
||||||
|
List<String> excludedValues = new ArrayList<>();
|
||||||
|
excludedValues.add(Sqlite.TABLE_TRACKING_BLOCK);
|
||||||
|
sqliteToExcel.setExcludeValuesFromTables(excludedValues);
|
||||||
sqliteToExcel.exportAllTables(fileName, new SQLiteToExcel.ExportListener() {
|
sqliteToExcel.exportAllTables(fileName, new SQLiteToExcel.ExportListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
|
@ -1453,10 +1456,11 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
intent.setDataAndType(uri, "application/vnd.ms-excel");
|
intent.setDataAndType(uri, "application/vnd.ms-excel");
|
||||||
Helper.notify_user(getApplicationContext(), intent, notificationIdTmp, BitmapFactory.decodeResource(getResources(),
|
Helper.notify_user(getApplicationContext(), intent, notificationIdTmp, BitmapFactory.decodeResource(getResources(),
|
||||||
R.mipmap.ic_launcher), Helper.NotifType.STORE, getString(R.string.save_over), getString(R.string.download_from, fileName));
|
R.mipmap.ic_launcher), Helper.NotifType.STORE, getString(R.string.save_over), getString(R.string.download_from, fileName));
|
||||||
Toasty.success(getApplicationContext(), getString(R.string.toast_saved),Toast.LENGTH_LONG).show();
|
Toasty.success(getApplicationContext(), getString(R.string.data_base_exported),Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception e) {
|
public void onError(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
Toasty.error(getApplicationContext(), getString(R.string.data_export_error_simple),Toast.LENGTH_LONG).show();
|
Toasty.error(getApplicationContext(), getString(R.string.data_export_error_simple),Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class Sqlite extends SQLiteOpenHelper {
|
||||||
static final String TABLE_BOOST_SCHEDULE = "BOOST_SCHEDULE";
|
static final String TABLE_BOOST_SCHEDULE = "BOOST_SCHEDULE";
|
||||||
|
|
||||||
//Table for blocking tracking domains
|
//Table for blocking tracking domains
|
||||||
static final String TABLE_TRACKING_BLOCK = "TRACKING_BLOCK";
|
public static final String TABLE_TRACKING_BLOCK = "TRACKING_BLOCK";
|
||||||
|
|
||||||
static final String COL_USER_ID = "USER_ID";
|
static final String COL_USER_ID = "USER_ID";
|
||||||
static final String COL_USERNAME = "USERNAME";
|
static final String COL_USERNAME = "USERNAME";
|
||||||
|
|
|
@ -897,6 +897,7 @@
|
||||||
<string name="calls_blocked">http calls blocked by the application</string>
|
<string name="calls_blocked">http calls blocked by the application</string>
|
||||||
<string name="list_of_blocked_domains">List of blocked calls</string>
|
<string name="list_of_blocked_domains">List of blocked calls</string>
|
||||||
<string name="submit">Submit</string>
|
<string name="submit">Submit</string>
|
||||||
|
<string name="data_base_exported">The data base has been exported!</string>
|
||||||
<!-- end languages -->
|
<!-- end languages -->
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue