Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask_android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kwadronaut
bitmask_android
Commits
f1c88d01
Commit
f1c88d01
authored
5 years ago
by
cyberta
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/se/leap/bitmaskclient/fragments/TetheringDialog.java
+13
-6
13 additions, 6 deletions
...java/se/leap/bitmaskclient/fragments/TetheringDialog.java
with
13 additions
and
6 deletions
app/src/main/java/se/leap/bitmaskclient/fragments/TetheringDialog.java
+
13
−
6
View file @
f1c88d01
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment