如何在Android Studio中为Kotlin提取字段
在Android Studio中,我想从像Java这样的类范围中的方法中提取字段toolbar
val toolbar = findViewById(R.id.my_toolbar) setupToolBar(toolbar)
我把光标放在工具栏上,右键点击find提取字段的function,但没有运气。 (Refactor – > Extract – > No Fields Extract)
感谢任何意见或评论。
使用像这样,它会工作
val toolbar = findViewById(R.id.my_toolbar) as Toolbar setupToolBar(toolbar)
尝试直接使用toolbar
ID作为variables(它适用于我)。
setupToolBar(my_toolbar)
- Intellij IDEAexception构建过程终止(XMx700m)
- IntelliJ运行vs运行jar,带有Social Oauth2的Springboot Kotlin,Multi模块Gradle项目
- 在kotlin中为Gradle脚本配置IntelliJ自动完成
- 任何如何在Maven依赖关系中启用Kotlin扩展函数的例子?
- 我怎样才能让我的JUnit测试在我的Kotlin + Gradle项目中编译和运行?
- Kotlin android扩展,软件包不能被导入
- 在intellij 16中创建Android应用时,Gradle同步失败
- 为什么IntelliJ Idea不能识别我的Spek测试?
- 修改测试文件模板