Verified Commit 723f02ad authored by Sarath's avatar Sarath
Browse files

Startup issue fix

parent 617d0db1
......@@ -931,11 +931,15 @@ public class BalanceActivity extends AppCompatActivity {
progress = null;
}
progress = new ProgressDialog(BalanceActivity.this);
progress.setCancelable(false);
progress.setTitle(R.string.app_name);
progress.setMessage(getString(R.string.please_wait));
progress.show();
try {
progress = new ProgressDialog(BalanceActivity.this);
progress.setCancelable(false);
progress.setTitle(R.string.app_name);
progress.setMessage(getString(R.string.please_wait));
progress.show();
} catch (Exception e) {
e.printStackTrace();
}
new Thread(new Runnable() {
@Override
......
......@@ -88,7 +88,7 @@ public class MainActivity2 extends Activity {
isVerified = extras.getBoolean("verified");
}
if (!ConnectivityStatus.hasConnectivity(MainActivity2.this)) {
if (!ConnectivityStatus.hasConnectivity(getApplicationContext())) {
new AlertDialog.Builder(MainActivity2.this)
.setTitle(R.string.app_name)
......@@ -130,19 +130,19 @@ public class MainActivity2 extends Activity {
try {
JSONObject obj = SamouraiSentinel.getInstance(MainActivity2.this).deserialize(null);
SamouraiSentinel.getInstance(MainActivity2.this).parseJSON(obj);
SamouraiSentinel.getInstance(getApplicationContext()).parseJSON(obj);
if (SamouraiSentinel.getInstance(MainActivity2.this).getXPUBs().keySet().size() < 1 &&
SamouraiSentinel.getInstance(MainActivity2.this).getBIP49().keySet().size() < 1 &&
SamouraiSentinel.getInstance(MainActivity2.this).getBIP84().keySet().size() < 1 &&
SamouraiSentinel.getInstance(MainActivity2.this).getLegacy().keySet().size() < 1) {
if (SamouraiSentinel.getInstance(getApplicationContext()).getXPUBs().keySet().size() < 1 &&
SamouraiSentinel.getInstance(getApplicationContext()).getBIP49().keySet().size() < 1 &&
SamouraiSentinel.getInstance(getApplicationContext()).getBIP84().keySet().size() < 1 &&
SamouraiSentinel.getInstance(getApplicationContext()).getLegacy().keySet().size() < 1) {
SamouraiSentinel.getInstance(MainActivity2.this).restoreFromPrefs();
}
if (SamouraiSentinel.getInstance(MainActivity2.this).getXPUBs().keySet().size() < 1 &&
SamouraiSentinel.getInstance(MainActivity2.this).getBIP49().keySet().size() < 1 &&
SamouraiSentinel.getInstance(MainActivity2.this).getBIP84().keySet().size() < 1 &&
SamouraiSentinel.getInstance(MainActivity2.this).getLegacy().keySet().size() < 1) {
if (SamouraiSentinel.getInstance(getApplicationContext()).getXPUBs().keySet().size() < 1 &&
SamouraiSentinel.getInstance(getApplicationContext()).getBIP49().keySet().size() < 1 &&
SamouraiSentinel.getInstance(getApplicationContext()).getBIP84().keySet().size() < 1 &&
SamouraiSentinel.getInstance(getApplicationContext()).getLegacy().keySet().size() < 1) {
Intent intent = new Intent(MainActivity2.this, InitActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
......@@ -183,19 +183,19 @@ public class MainActivity2 extends Activity {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
feeThread();
exchangeRateThread();
// feeThread();
// exchangeRateThread();
}
BackgroundManager.get(MainActivity2.this).addListener(bgListener);
// BackgroundManager.get(MainActivity2.this).addListener(bgListener);
}
void gotoBalanceActivity() {
try {
JSONObject obj = SamouraiSentinel.getInstance(MainActivity2.this).deserialize(null);
SamouraiSentinel.getInstance(MainActivity2.this).parseJSON(obj);
JSONObject obj = SamouraiSentinel.getInstance(getApplicationContext()).deserialize(null);
SamouraiSentinel.getInstance(getApplicationContext()).parseJSON(obj);
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
......@@ -228,7 +228,6 @@ public class MainActivity2 extends Activity {
} else {
Intent intent = new Intent(MainActivity2.this, BalanceActivity.class);
startActivity(intent);
finish();
}
}
......
......@@ -215,9 +215,7 @@ public class SamouraiSentinel {
if(obj != null && obj.has("receives")) {
ReceiveLookAtUtil.getInstance().fromJSON(obj.getJSONArray("receives"));
}
Log.i("CALLED",obj.toString());
if(obj.has("dojo")) {
Log.i("CALLED","dojo".concat(obj.toString()));
DojoUtil.getInstance(context).fromJSON(new JSONObject(obj.getString("dojo")));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment