Fixes some crashes
This commit is contained in:
parent
b103f661a9
commit
feb45c5f93
|
@ -135,6 +135,7 @@ public class ProxyActivity extends BaseActivity {
|
|||
String proxy_passwordVal = proxy_password.getText().toString().trim();
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.SET_PROXY_HOST, hostVal);
|
||||
if( portVal.matches("\\d+") )
|
||||
editor.putInt(Helper.SET_PROXY_PORT, Integer.parseInt(portVal));
|
||||
editor.putString(Helper.SET_PROXY_LOGIN, proxy_loginVal);
|
||||
editor.putString(Helper.SET_PROXY_PASSWORD, proxy_passwordVal);
|
||||
|
|
|
@ -106,6 +106,7 @@ public class LiveNotificationService extends Service {
|
|||
int type = sharedpreferences.getInt(Helper.SET_PROXY_TYPE, 0);
|
||||
proxy = null;
|
||||
if( proxyEnabled ){
|
||||
try{
|
||||
String host = sharedpreferences.getString(Helper.SET_PROXY_HOST, "127.0.0.1");
|
||||
int port = sharedpreferences.getInt(Helper.SET_PROXY_PORT, 8118);
|
||||
if( type == 0 )
|
||||
|
@ -124,6 +125,10 @@ public class LiveNotificationService extends Service {
|
|||
};
|
||||
Authenticator.setDefault(authenticator);
|
||||
}
|
||||
}catch (Exception e){
|
||||
proxy = null;
|
||||
}
|
||||
|
||||
}
|
||||
if( intent == null || intent.getBooleanExtra("stop", false) ) {
|
||||
stop = true;
|
||||
|
|
Loading…
Reference in New Issue