Skip to content
Snippets Groups Projects
Commit f1c88d01 authored by cyberta's avatar cyberta
Browse files

fallback to genereal wifi settings if tethering settings activity cannot not be found

parent f9e1a144
No related branches found
No related tags found
No related merge requests found
package se.leap.bitmaskclient.fragments;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Intent;
import android.graphics.drawable.Drawable;
......@@ -200,12 +201,18 @@ public class TetheringDialog extends AppCompatDialogFragment implements Observer
spannable.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View widget) {
try {
final Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
final ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.TetherSettings");
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
} catch (ActivityNotFoundException e) {
Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
startActivity(intent);
}
}
}, startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment