some cleaning up

This commit is contained in:
m2049r 2017-08-15 12:04:25 +02:00
parent 69729e5257
commit 6611539491
4 changed files with 9 additions and 52 deletions

View File

@ -24,9 +24,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.StrictMode;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.KeyEvent;
@ -34,23 +32,14 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;
import com.m2049r.xmrwallet.model.WalletManager;
import com.m2049r.xmrwallet.util.Helper;
import java.io.File;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class LoginActivity extends Activity implements LoginFragment.LoginFragmentListener {
static final String TAG = "LoginActivity";
@ -189,7 +178,8 @@ public class LoginActivity extends Activity implements LoginFragment.LoginFragme
} else {
String msg = getString(R.string.message_strorage_not_permitted);
Log.e(TAG, msg);
throw new IllegalStateException(msg);
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
//throw new IllegalStateException(msg);
}
break;
default:
@ -197,14 +187,7 @@ public class LoginActivity extends Activity implements LoginFragment.LoginFragme
}
void startLoginFragment() {
// Create a new Fragment to be placed in the activity layout
Fragment fragment = new LoginFragment();
// In case this activity was started with special instructions from an
// Intent, pass the Intent's extras to the fragment as arguments
//firstFragment.setArguments(getIntent().getExtras());
// Add the fragment to the 'fragment_container' FrameLayout
getFragmentManager().beginTransaction()
.add(R.id.fragment_container, fragment).commit();
Log.d(TAG, "fragment added");

View File

@ -19,7 +19,6 @@ package com.m2049r.xmrwallet;
import android.app.Fragment;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.StrictMode;
import android.util.Log;
@ -40,7 +39,6 @@ import android.widget.Toast;
import android.widget.ToggleButton;
import com.m2049r.xmrwallet.model.WalletManager;
import com.m2049r.xmrwallet.util.Helper;
import java.io.File;
import java.io.IOException;

View File

@ -66,9 +66,6 @@ public class WalletActivity extends Activity implements WalletFragment.WalletFra
disconnectWalletService();
}
// private String title = null;
@Override
protected void onStop() {
Log.d(TAG, "onStop()");
@ -88,39 +85,18 @@ public class WalletActivity extends Activity implements WalletFragment.WalletFra
super.onCreate(savedInstanceState);
setContentView(R.layout.wallet_activity);
// Check that the activity is using the layout version with
// the fragment_container FrameLayout
if (findViewById(R.id.fragment_container) != null) {
Log.d(TAG, "fragment_container not null");
// However, if we're being restored from a previous state,
// then we don't need to do anything and should return or else
// we could end up with overlapping fragments.
if (savedInstanceState != null) {
return;
}
Fragment walletFragment = new WalletFragment();
getFragmentManager().beginTransaction()
.add(R.id.fragment_container, walletFragment).commit();
Log.d(TAG, "fragment added");
// Create a new Fragment to be placed in the activity layout
Fragment firstFragment = new WalletFragment();
// In case this activity was started with special instructions from an
// Intent, pass the Intent's extras to the fragment as arguments
firstFragment.setArguments(getIntent().getExtras());
// Add the fragment to the 'fragment_container' FrameLayout
getFragmentManager().beginTransaction()
.add(R.id.fragment_container, firstFragment).commit();
Log.d(TAG, "fragment added");
}
// TODO do stuff with savedInstanceState
// TODO do stuff with savedInstanceState ?
if (savedInstanceState != null) {
return;
}
//Log.d(TAG, "no savedInstanceState");
startWalletService();
//Log.d(TAG, "onCreate() done.");
Log.d(TAG, "onCreate() done.");
}

View File

@ -41,6 +41,6 @@
<string name="prompt_problems">Problems</string>
<string name="message_strorage_not_writable">External Storage is not writable! Panic!</string>
<string name="message_strorage_not_permitted">External Storage permission not granted! Panic!</string>
<string name="message_strorage_not_permitted">We really need those External Storage permissions!</string>
</resources>