Added support menu

This commit is contained in:
M66B 2015-10-25 16:48:41 +01:00
parent ee4833285f
commit ca8c5eeb6c
4 changed files with 19 additions and 6 deletions

View File

@ -57,7 +57,7 @@ No, unlike most of the similar closed source alternatives.
Support
-------
* Questions: please [use this forum](http://forum.xda-developers.com/android/apps-games/netguard-t3233012)
* Questions: please [use this forum](http://forum.xda-developers.com/showthread.php?t=3233012)
* Feature requests and bugs: please [report an issue](https://github.com/M66B/NetGuard/issues/new)
Please do not use GitHub for questions.

View File

@ -6,6 +6,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.net.Uri;
import android.net.VpnService;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
@ -196,12 +197,20 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
case R.id.menu_vpn_settings:
// Open VPN settings
Intent intent = new Intent("android.net.vpn.SETTINGS");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (intent.resolveActivity(getPackageManager()) != null)
startActivity(intent);
Intent vpn = new Intent("android.net.vpn.SETTINGS");
if (vpn.resolveActivity(getPackageManager()) != null)
startActivity(vpn);
else
Log.w(TAG, intent + " not available");
Log.w(TAG, vpn + " not available");
return true;
case R.id.menu_support:
Intent xda = new Intent(Intent.ACTION_VIEW);
xda.setData(Uri.parse("http://forum.xda-developers.com/showthread.php?t=3233012"));
if (xda.resolveActivity(getPackageManager()) != null)
startActivity(xda);
else
Log.w(TAG, xda + " not available");
return true;
case R.id.menu_about:

View File

@ -20,6 +20,9 @@
<item
android:id="@+id/menu_vpn_settings"
android:title="@string/menu_vpn_settings" />
<item
android:id="@+id/menu_support"
android:title="@string/menu_support" />
<item
android:id="@+id/menu_about"
android:title="@string/menu_about" />

View File

@ -5,5 +5,6 @@
<string name="menu_wifi">Toggle Wi-Fi</string>
<string name="menu_other">Toggle other</string>
<string name="menu_vpn_settings">Android VPN settings</string>
<string name="menu_support">Support</string>
<string name="menu_about">About</string>
</resources>