Change on the managment of the id when saving on database
This commit is contained in:
parent
3a6f4635b0
commit
eb351bfbfa
3 changed files with 5 additions and 3 deletions
|
@ -112,7 +112,6 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
|
|||
|
||||
@Override
|
||||
public void importAccountFromSeed(CryptoNetAccount account, final Context context) {
|
||||
|
||||
if(account instanceof GrapheneAccount) {
|
||||
final GrapheneAccount grapheneAccount = (GrapheneAccount) account;
|
||||
|
||||
|
@ -123,7 +122,8 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
|
|||
GrapheneAccount fetch = (GrapheneAccount) answer;
|
||||
grapheneAccount.setAccountId(fetch.getAccountId());
|
||||
CrystalDatabase db = CrystalDatabase.getAppDatabase(context);
|
||||
db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount);
|
||||
long[] idAccount = db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount);
|
||||
grapheneAccount.setId(idAccount[0]);
|
||||
db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount));
|
||||
subscribeBitsharesAccount(grapheneAccount.getId(),grapheneAccount.getAccountId(),context);
|
||||
}
|
||||
|
|
|
@ -252,6 +252,8 @@ public class FileBackupManager implements FileServiceRequestsListener {
|
|||
account.setName(validatorRequest.getAccountName());
|
||||
BitsharesAccountManager bManger = new BitsharesAccountManager();
|
||||
bManger.importAccountFromSeed(account,request.getContext());
|
||||
|
||||
|
||||
request.setStatus(ImportBackupRequest.StatusCode.SUCCEEDED);
|
||||
}else{
|
||||
request.setStatus(ImportBackupRequest.StatusCode.FAILED); //TODO reason couldn't insert seed
|
||||
|
|
|
@ -187,7 +187,7 @@ public class CryptoNetBalanceViewHolder extends RecyclerView.ViewHolder {
|
|||
* Binds this view with the data of an element of the list
|
||||
*/
|
||||
public void bindTo(final CryptoNetBalance balance) {
|
||||
if (balance == null){
|
||||
if (balance == null ){
|
||||
cryptoNetName.setText("loading...");
|
||||
} else {
|
||||
final CryptoNetBalanceViewHolder thisViewHolder = this;
|
||||
|
|
Loading…
Reference in a new issue