wownero
/
wownerujo
Archived
4
0
Fork 0
* cache getAddress()

* savedInstanceState handling

* v0.8.0.2
upstream
m2049r 7 years ago committed by GitHub
parent be236cce1b
commit cc46dc06c4

@ -8,8 +8,8 @@ android {
applicationId "com.m2049r.xmrwallet"
minSdkVersion 21
targetSdkVersion 25
versionCode 14
versionName "0.8.0.1"
versionCode 15
versionName "0.8.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {

@ -75,13 +75,13 @@ public class LoginActivity extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate()");
super.onCreate(savedInstanceState);
setContentView(R.layout.login_activity);
setContentView(R.layout.login_activity);
if (savedInstanceState != null) {
return;
// we don't store anything ourselves
}
setContentView(R.layout.login_activity);
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

@ -150,14 +150,16 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate()");
super.onCreate(savedInstanceState);
setContentView(R.layout.wallet_activity);
if (savedInstanceState != null) {
return;
// we don't store anything ourselves
}
setContentView(R.layout.wallet_activity);
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(R.string.app_name);
setSupportActionBar(toolbar);
toolbar.setTitle(R.string.app_name);
boolean testnet = WalletManager.getInstance().isTestNet();
if (testnet) {
toolbar.setBackgroundResource(R.color.colorPrimaryDark);

@ -36,6 +36,7 @@ public class Wallet {
Wallet(long handle) {
this.handle = handle;
getAddress(); // cache address for later
}
public enum Status {
@ -50,8 +51,6 @@ public class Wallet {
ConnectionStatus_WrongVersion
}
//public native long createWalletListenerJ();
public native String getSeed();
public native String getSeedLanguage();
@ -68,11 +67,15 @@ public class Wallet {
public native boolean setPassword(String password);
private String address = null;
public String getAddress() {
String address = getAddressJ();
if (address == null) {
address = getAddressJ();
}
if (!Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet())) {
// just die!
throw new IllegalStateException("Wallet returned invalid address!");
throw new IllegalStateException("Wallet returned invalid address: " + address);
}
return address;
}