uniapp获取context

@JSMethod(uiThread = true)
public void testText(String come, JSCallback callBack){
    Context context = this.mWXSDKInstance.getContext();
    Context context2 = this.mUniSDKInstance.getContext();
}

 两种方式都可以获取到context,且内容一致,项目中我使用了this.mWXSDKInstance.getContext()来获取。

原文地址:https://www.cnblogs.com/codeit/p/15411169.html