当前位置: 移动技术网 > 移动技术>移动开发>Android > Android开发中WebView处理方法

Android开发中WebView处理方法

2018年11月01日  | 移动技术网移动技术  | 我要评论

今天的任务为处理webview,代码如下:“

notificationreceiver.java:

package com.bignerdranch.android.photogallery;

import android.app.activity;
import android.app.notification;
import android.content.broadcastreceiver;
import android.content.context;
import android.content.intent;
import android.support.v4.app.notificationmanagercompat;
import android.util.log;

public class notificationreceiver extends broadcastreceiver {
 private static final string tag = "notificationreceiver";

 @override
 public void onreceive(context c, intent i) {
  log.i(tag, "received result: " + getresultcode());
  if (getresultcode() != activity.result_ok) {
// a foreground activity cancelled the broadcast
return;
  }

  int requestcode = i.getintextra(pollservice.request_code, 0);
  notification notification = (notification)
 i.getparcelableextra(pollservice.notification);

  notificationmanagercompat notificationmanager = 
 notificationmanagercompat.from(c);
  notificationmanager.notify(requestcode, notification);
 }
}

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网