本文整理汇总了Java中android.webkit.PermissionRequest类的典型用法代码示例。如果您正苦于以下问题:Java PermissionRequest类的具体用法?Java PermissionRequest怎么用?Java PermissionRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PermissionRequest类属于android.webkit包,在下文中一共展示了PermissionRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(PermissionRequest request) {
// request.deny();
if (this.mRealWebChromeClient != null){
this.mRealWebChromeClient.onPermissionRequest(request);
return;
}
super.onPermissionRequest(request);
}
示例2: onPermissionRequestCanceled
import android.webkit.PermissionRequest; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequestCanceled(PermissionRequest request) {
if (this.mRealWebChromeClient != null){
this.mRealWebChromeClient.onPermissionRequestCanceled(request);
return;
}
super.onPermissionRequestCanceled(request);
}
示例3: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@Override
public void onPermissionRequest(PermissionRequest request) {
super.onPermissionRequest(request);
if(client != null) {
if(Build.VERSION.SDK_INT >= 21) {
client.onPermissionRequest(request);
}
}
}
示例4: onPermissionRequestCanceled
import android.webkit.PermissionRequest; //导入依赖的package包/类
@Override
public void onPermissionRequestCanceled(PermissionRequest request) {
super.onPermissionRequestCanceled(request);
if(client != null) {
if(Build.VERSION.SDK_INT >= 21) {
client.onPermissionRequestCanceled(request);
}
}
}
示例5: onCreateView
import android.webkit.PermissionRequest; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
mWebRTCWebView = (WebView) rootView.findViewById(R.id.fragment_main_webview);
setUpWebViewDefaults(mWebRTCWebView);
mWebRTCWebView.loadUrl("https://apprtc-m.appspot.com/");
mWebRTCWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onPermissionRequest(final PermissionRequest request) {
Log.d(TAG, "onPermissionRequest");
getActivity().runOnUiThread(new Runnable() {
@TargetApi(Build.VERSION_CODES.L)
@Override
public void run() {
if(request.getOrigin().toString().equals("https://apprtc-m.appspot.com/")) {
request.grant(request.getResources());
} else {
request.deny();
}
}
});
}
});
return rootView;
}
示例6: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
request.grant(request.getResources());
}
示例7: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
/**
* We override this here to keep taps on VPAID ads that abuse their power
*
* @param request details around the permission request, see {@link PermissionRequest}
*/
@Override
public void onPermissionRequest(PermissionRequest request) {
if (Build.VERSION.SDK_INT >= 21)
request.deny();
}
示例8: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(final PermissionRequest request) {
Log.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
request.grant(request.getResources());
}
示例9: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(final PermissionRequest request) {
LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
request.grant(request.getResources());
}
示例10: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@Override
public void onPermissionRequest(PermissionRequest request) {
super.onPermissionRequest(request);
}
示例11: onPermissionRequestCanceled
import android.webkit.PermissionRequest; //导入依赖的package包/类
@Override
public void onPermissionRequestCanceled(PermissionRequest request) {
super.onPermissionRequestCanceled(request);
}
示例12: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(final PermissionRequest request) {
Log.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
request.grant(request.getResources());
}
示例13: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@Override
public void onPermissionRequest(PermissionRequest request) {
super.onPermissionRequest(request);
}
示例14: onPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
Log.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
request.grant(request.getResources());
}
示例15: OnPermissionRequest
import android.webkit.PermissionRequest; //导入依赖的package包/类
public OnPermissionRequest(PermissionRequest request) {
this.request = request;
}