Commit 37c23429 authored by kenan's avatar kenan

悬浮窗权限

parent fed4dcfd
...@@ -2,6 +2,7 @@ package cn.garymb.ygomobile.ui.adapters; ...@@ -2,6 +2,7 @@ package cn.garymb.ygomobile.ui.adapters;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.provider.Settings; import android.provider.Settings;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -36,7 +37,7 @@ public class ServerListAdapter extends BaseRecyclerAdapterPlus<ServerInfo, Serve ...@@ -36,7 +37,7 @@ public class ServerListAdapter extends BaseRecyclerAdapterPlus<ServerInfo, Serve
builder.setMessage(R.string.join_helper_tip); builder.setMessage(R.string.join_helper_tip);
builder.setLeftButtonText(R.string.Open_Alert_Window); builder.setLeftButtonText(R.string.Open_Alert_Window);
builder.setLeftButtonListener((dlg, s) -> { builder.setLeftButtonListener((dlg, s) -> {
getContext().startActivity(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION)); getContext().startActivity(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:"+context.getPackageName())));
dlg.dismiss(); dlg.dismiss();
}); });
builder.show(); builder.show();
......
...@@ -66,7 +66,7 @@ public class PermissionUtil { ...@@ -66,7 +66,7 @@ public class PermissionUtil {
dialog.setLeftButtonListener(new DialogInterface.OnClickListener() { dialog.setLeftButtonListener(new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
context.startActivity(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION)); context.startActivity(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:"+context.getPackageName())));
dialog.dismiss(); dialog.dismiss();
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment