setup Tor at app start, and config immediately when pref is changed
This adds an Application subclass to get the onCreate() method, which is called once at the first start up of the app, before any Activity starts. Tor is configured there to ensure it is setup before anything happens. This also moves the "Use Tor" pref listener to a more appropriate place.
This commit is contained in:
parent
6bd2468d44
commit
d3879a0398
6 changed files with 54 additions and 29 deletions
|
|
@ -41,7 +41,6 @@ public class Downloader {
|
|||
* @param language the language (usually a 2-character code) to set as the preferred language
|
||||
* @return the contents of the specified text file*/
|
||||
public static String download(String siteUrl, String language) {
|
||||
NetCipher.useTor();
|
||||
String ret = "";
|
||||
try {
|
||||
URL url = new URL(siteUrl);
|
||||
|
|
@ -86,7 +85,6 @@ public class Downloader {
|
|||
* @return the contents of the specified text file*/
|
||||
public static String download(String siteUrl) {
|
||||
String ret = "";
|
||||
NetCipher.useTor();
|
||||
|
||||
try {
|
||||
URL url = new URL(siteUrl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue