Set its id to the new account instance

This commit is contained in:
Shinokuni 2019-05-18 16:15:40 +02:00
parent 572f1f7c45
commit 60797cf76c
2 changed files with 5 additions and 4 deletions

View File

@ -81,9 +81,11 @@ public class AddAccountActivity extends AppCompatActivity {
startActivity(intent);
finish();
} else
} else {
binding.addAccountValidate.setEnabled(true);
Toast.makeText(AddAccountActivity.this, "Impossible to login",
Toast.LENGTH_SHORT).show();
Toast.LENGTH_LONG).show();
}
}
@Override

View File

@ -55,9 +55,8 @@ public class NextNewsRepository extends ARepository {
account.setDisplayedName(user.getDisplayName());
account.setCurrentAccount(true);
database.accountDao().insert(account);
account.setId((int) database.accountDao().insert(account));
emitter.onSuccess(true);
} else
emitter.onSuccess(false);
});