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()来获取。

posted @ 2021-10-15 15:12  盛世芳华  阅读(1792)  评论(0编辑  收藏  举报