短剧
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.WebView;
|
||||
|
||||
public class JavascriptInterfacePlayLetUtils {
|
||||
private Activity mContext;
|
||||
private WebView mWebView;
|
||||
private static JavascriptInterfacePlayLetUtils sInstance;
|
||||
|
||||
public static JavascriptInterfacePlayLetUtils getInstance() {
|
||||
|
||||
synchronized (JavascriptInterfacePlayLetUtils.class) {
|
||||
|
||||
sInstance = new JavascriptInterfacePlayLetUtils();
|
||||
|
||||
return sInstance;
|
||||
}
|
||||
}
|
||||
|
||||
public JavascriptInterfacePlayLetUtils setmContext(Activity mContext, WebView mWebView) {
|
||||
this.mContext = mContext;
|
||||
this.mWebView = mWebView;
|
||||
return this;
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void postEvent(String name, String data) {
|
||||
Log.e("TAG", "postEvent name==" + name);
|
||||
Log.e("TAG", "postEvent data==" + data);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void postWeakBalance(String data) {
|
||||
Log.e("TAG", "postWeakBalance data==" + data);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.JavascriptInterface;
|
||||
@@ -676,4 +677,5 @@ public class JavascriptInterfaceUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user