"android backup/restore: how to backup an internal database?" Code Answer

2

a cleaner approach would be to create a custom backuphelper:

public class dbbackuphelper extends filebackuphelper {

    public dbbackuphelper(context ctx, string dbname) {
        super(ctx, ctx.getdatabasepath(dbname).getabsolutepath());
    }
}

and then add it to backupagenthelper:

public void oncreate() {
    addhelper(database, new dbbackuphelper(this, db.file));
}
By Ahmad Asjad on March 25 2022

Answers related to “android backup/restore: how to backup an internal database?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.