diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2014-08-17 11:47:14 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2014-08-17 11:47:14 +0200 |
commit | 45b6bfcccc331d62c6984aea789cee6677144518 (patch) | |
tree | 4652b6724ed6cff34939d94ec1f98a3c6657175a | |
parent | 4a271a922348590e999e209535f050fd861cac11 (diff) | |
download | andiodine-45b6bfcccc331d62c6984aea789cee6677144518.tar.gz andiodine-45b6bfcccc331d62c6984aea789cee6677144518.zip |
Make link in IodineVpnException message clickable #4
-rw-r--r-- | src/org/xapek/andiodine/FragmentStatus.java | 11 | ||||
-rw-r--r-- | src/org/xapek/andiodine/IodineVpnService.java | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/org/xapek/andiodine/FragmentStatus.java b/src/org/xapek/andiodine/FragmentStatus.java index 198271a..ee14562 100644 --- a/src/org/xapek/andiodine/FragmentStatus.java +++ b/src/org/xapek/andiodine/FragmentStatus.java @@ -7,6 +7,9 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; +import android.text.SpannableString; +import android.text.method.LinkMovementMethod; +import android.text.util.Linkify; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -28,10 +31,16 @@ public class FragmentStatus extends Fragment { public void onReceive(Context context, Intent intent) { Log.d(TAG, "Got intent: " + intent); if (IodineVpnService.ACTION_STATUS_ERROR.equals(intent.getAction())) { + final TextView message = new TextView(context); + final String stringMessage = intent.getStringExtra(IodineVpnService.EXTRA_ERROR_MESSAGE); + final SpannableString s = new SpannableString(stringMessage); + Linkify.addLinks(s, Linkify.WEB_URLS); + message.setText(s); + message.setMovementMethod(LinkMovementMethod.getInstance()); new AlertDialog.Builder(FragmentStatus.this.getActivity())// .setIcon(R.drawable.error) // .setTitle("Error") // - .setMessage(intent.getStringExtra(IodineVpnService.EXTRA_ERROR_MESSAGE)) // + .setView(message) .create() // .show(); } else if (IodineVpnService.ACTION_STATUS_CONNECT.equals(intent.getAction())) { diff --git a/src/org/xapek/andiodine/IodineVpnService.java b/src/org/xapek/andiodine/IodineVpnService.java index 7c4443e..dcc3715 100644 --- a/src/org/xapek/andiodine/IodineVpnService.java +++ b/src/org/xapek/andiodine/IodineVpnService.java @@ -323,9 +323,8 @@ public class IodineVpnService extends VpnService implements Runnable { parcelFD = b.establish(); } catch (Exception e) { if (e.getMessage().contains("fwmark") || e.getMessage().contains("iptables")) { - // bug https://github.com/yvesf/andiodine/issues/4 throw new IodineVpnException( - "Error while creating interface, please check issue #4 at https://github.com/yvesf/andiodine/issues/4"); + "Error while creating interface, please check issue #9 at https://github.com/yvesf/andiodine/issues/9"); } else { throw new IodineVpnException("Error while creating interface: " + e.getMessage()); |