use of run.wallet.iota.ui.fragment.SnTrFragment in project run-wallet-android by runplay.
the class MainActivity method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch(resultCode) {
case Constants.REQUEST_CODE_LOGIN:
case 0:
inputManager.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0);
navigationView.getMenu().performIdentifierAction(R.id.nav_wallet, 0);
break;
case Constants.REQUEST_RESTART_KILL_APP:
FragmentManager fragman = getFragmentManager();
FragmentTransaction fragmentTransaction = fragman.beginTransaction();
for (Class fragmentClass : fragmentsToKill) {
String tag = fragmentClass.getCanonicalName();
Fragment fragmentToKill = fragman.findFragmentByTag(tag);
if (fragmentToKill != null) {
fragmentTransaction.remove(fragmentToKill);
}
}
TaskManager.stopAndDestroyAllTasks(this);
Store.wipeAllStoreSavedData(this);
fragmentTransaction.commit();
WalletAddressCardAdapter.clear();
WalletTransfersCardAdapter.clear();
inputManager.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0);
UiManager.openFragment(this, WelcomeFragment.class);
break;
case Constants.REQUEST_GO_TOR:
UiManager.openFragmentBackStack(this, TorFragment.class);
break;
case Constants.REQUEST_GO_COLORS:
UiManager.openFragmentBackStack(this, ColorFragment.class);
break;
}
if (data != null) {
if (resultCode == Constants.DONATE_NOW) {
Bundle bundle = data.getExtras();
if (bundle != null) {
Fragment fragment = new SnTrFragment();
fragment.setArguments(bundle);
showFragment(fragment, true);
}
} else if (Intent.ACTION_VIEW.equals(data.getAction())) {
QRCode qrCode = new QRCode();
Uri uri = data.getData();
if (uri != null && uri.getQueryParameter("address:") != null && !uri.getQueryParameter("address:").isEmpty()) {
qrCode.setAddress(uri.getQueryParameter("address:"));
qrCode.setAmount(uri.getQueryParameter("amount:"));
qrCode.setMessage(uri.getQueryParameter("message:"));
Bundle bundle = new Bundle();
bundle.putParcelable(Constants.QRCODE, qrCode);
Fragment fragment = new SnTrFragment();
fragment.setArguments(bundle);
showFragment(fragment, true);
}
}
}
}
Aggregations