rework inter-process communication

This commit is contained in:
Max Lv
2013-05-26 18:42:54 +08:00
parent b19f666226
commit 0cd66bf594
6 changed files with 137 additions and 129 deletions
@@ -5,6 +5,7 @@ import android.os.Bundle
import android.net.VpnService
import android.content.Intent
import android.util.Log
import android.preference.PreferenceManager
class ShadowVpnActivity extends Activity {
@@ -21,8 +22,9 @@ class ShadowVpnActivity extends Activity {
override def onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
resultCode match {
case Activity.RESULT_OK => {
val it: Intent = new Intent(this, classOf[ShadowVpnService])
startService(it)
val intent: Intent = new Intent(this, classOf[ShadowVpnService])
Extra.put(PreferenceManager.getDefaultSharedPreferences(this), intent)
startService(intent)
}
case _ => {
Log.e(Shadowsocks.TAG, "Failed to start VpnService")