第一步:Android对Js的接口,新建AndroidInterfaceForJs.js
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.RequiresApi;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.widget.Toast;
import com.just.agentweb.AgentWeb;
import com.yidumedical.ui.activity.PAWebActivity;
/**
* Created by shiby on 2018/1/24.
*/
public class AndroidInterfaceForJS {
private Handler deliver = new Handler(Looper.getMainLooper());
private AgentWeb agent;
private Context context;
public AndroidInterfaceForJS(AgentWeb agent, Context context) {
this.agent = agent;
this.context = context;
}