Commit 29686ee8 authored by Max Lv's avatar Max Lv

fix auto start

parent a3f44403
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<activity <activity
android:name=".ShadowsocksRunnerActivity" android:name=".ShadowsocksRunnerActivity"
android:theme="@style/PopupTheme" android:theme="@android:style/Theme.NoDisplay"
android:launchMode="singleTask"> android:launchMode="singleTask">
</activity> </activity>
......
...@@ -66,6 +66,7 @@ class ShadowsocksReceiver extends BroadcastReceiver { ...@@ -66,6 +66,7 @@ class ShadowsocksReceiver extends BroadcastReceiver {
if (isAutoConnect && isInstalled) { if (isAutoConnect && isInstalled) {
val intent = new Intent(context, classOf[ShadowsocksRunnerActivity]) val intent = new Intent(context, classOf[ShadowsocksRunnerActivity])
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
context.startActivity(intent) context.startActivity(intent)
} }
} }
......
...@@ -67,6 +67,7 @@ class ShadowsocksRunnerActivity extends Activity { ...@@ -67,6 +67,7 @@ class ShadowsocksRunnerActivity extends Activity {
} }
} else { } else {
bgService.start(ConfigUtils.load(settings)) bgService.start(ConfigUtils.load(settings))
finish()
} }
} }
override def onServiceDisconnected(name: ComponentName) { override def onServiceDisconnected(name: ComponentName) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment