android - 使用 viewmodel 加载 Webview
问题描述
我之前使用 extends Activity 和 onCreate() 来加载在 xml 布局中定义的任何 webview。例如
public void onCreate(){
WebView webview = findViewById(R.id.my_webview);
webview.loadUrl("url");
---
但是现在,我们必须将所有这些逻辑移至 ViewModel。我不知道怎么做,你能请有人解释一下处理吗?我浏览了几个博客,但没有看到这样做的任何用途。
解决方案
推荐阅读
- javascript - 有没有办法让firebase触发器在更新多个子集合时触发?
- stata - Null hypothesis testing
- jquery - Error Internal Server Error blueimp jquery file upload
- ffmpeg - 在 discord.py 中使用 ffmpeg 库时出现 OpusError
- android - WebService 请求从 Android 代码转码到 Swift 代码
- xamarin - Xamarin 缺少指令
- javascript - Discord.js 克隆类别中的特定语音通道,“X”次
- compilation - 使用 javassist 创建一个类并从代码中加载
- java - 春天云流kafka背压
- python - 将多个自定义函数应用于 Python 中 Pandas 中多个 groupby 对象的多个列