Move app initialization out of EmailListActivity so it can be used elsewhere
This commit is contained in:
@@ -28,7 +28,6 @@ import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.i2p.android.router.service.IRouterState;
|
||||
|
||||
@@ -413,24 +412,6 @@ public class EmailListActivity extends ActionBarActivity implements
|
||||
mDrawerToggle.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
private class InitActivities {
|
||||
private final Context ctx;
|
||||
private final String myDir;
|
||||
|
||||
public InitActivities(Context c) {
|
||||
ctx = c;
|
||||
// This needs to be changed so that we can have an alternative place
|
||||
myDir = c.getFilesDir().getAbsolutePath();
|
||||
}
|
||||
|
||||
void initialize() {
|
||||
// Set up the locations so settings can find them
|
||||
System.setProperty("i2p.dir.base", myDir);
|
||||
System.setProperty("i2p.dir.config", myDir);
|
||||
System.setProperty("wrapper.logfile", myDir + "/wrapper.log");
|
||||
}
|
||||
}
|
||||
|
||||
// FolderFragment.OnEmailSelectedListener
|
||||
|
||||
@Override
|
||||
|
||||
27
app/src/main/java/i2p/bote/android/InitActivities.java
Normal file
27
app/src/main/java/i2p/bote/android/InitActivities.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package i2p.bote.android;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
class InitActivities {
|
||||
private final Context ctx;
|
||||
private final String myDir;
|
||||
|
||||
public InitActivities(Context c) {
|
||||
ctx = c;
|
||||
// This needs to be changed so that we can have an alternative place
|
||||
myDir = c.getFilesDir().getAbsolutePath();
|
||||
}
|
||||
|
||||
void initialize() {
|
||||
// Don't initialize twice
|
||||
if (System.getProperty("i2pbote.initialized", "false").equals("true"))
|
||||
return;
|
||||
|
||||
// Set up the locations so settings can find them
|
||||
System.setProperty("i2p.dir.base", myDir);
|
||||
System.setProperty("i2p.dir.config", myDir);
|
||||
System.setProperty("wrapper.logfile", myDir + "/wrapper.log");
|
||||
|
||||
System.setProperty("i2pbote.initialized", "true");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user