JavaShuo
欄目
標籤
Resource IDs cannot be used in a switch statement in Android library modules.
時間 2021-07-10
欄目
Android
简体版
原文
原文鏈接
在組件化開發中,當我們使用switch來進行判斷操作時,會報這個錯誤,原因是R.id.XXX這類資源id在主application中是final,是常量,而在library中,是沒有final的。這裏盜個圖: 所以我們需要將switch轉變爲if else,直接選中switch,alt+enter,選擇replace switch with if .
>>阅读原文<<
相關文章
1.
【Android 報錯】Resource IDs cannot be used in a switch statement in Android library modules
2.
Resource IDs cannot be used in a switch statement in Android library modules
3.
Android開發問題之--Validates using resource IDs in a switch statement in Android library module
4.
require function is used in a way in which dependencies cannot be statically extracted
5.
Constructor call must be the first statement in a constructor
6.
Cannot execute statement in a READ ONLY transaction.
7.
[django] Exception Value: DatabaseWrapper objects created in a thread can only be used in that s...
8.
[django] Exception Value: DatabaseWrapper objects created in a thread can only be used in that same
9.
The type OneInterface cannot be a superinterface of OneInterfaceImpl; a superinterface must be an in
10.
Codelab for Android Design Support Library used in I/O Rewind Bangkok session
更多相關文章...
•
SQL IN 操作符
-
SQL 教程
•
Swift for-in 循環
-
Swift 教程
•
JDK13 GA發佈:5大特性解讀
•
Kotlin學習(一)基本語法
相關標籤/搜索
method...in
in+exists
in&&exists
for...in
for..in
for.....in
In PHP
between+in
modules
ids
Android
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
css 讓chrome支持小於12px的文字
2.
集合的一點小總結
3.
ejb
4.
Selenium WebDriver API
5.
人工智能基礎,我的看法
6.
Non-local Neural及Self-attention
7.
Hbuilder 打開iOS真機調試操作
8.
improved open set domain adaptation with backpropagation 學習筆記
9.
Chrome插件 GitHub-Chart Commits3D直方圖視圖
10.
CISCO ASAv 9.15 - 體驗思科上一代防火牆
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
1.
【Android 報錯】Resource IDs cannot be used in a switch statement in Android library modules
2.
Resource IDs cannot be used in a switch statement in Android library modules
3.
Android開發問題之--Validates using resource IDs in a switch statement in Android library module
4.
require function is used in a way in which dependencies cannot be statically extracted
5.
Constructor call must be the first statement in a constructor
6.
Cannot execute statement in a READ ONLY transaction.
7.
[django] Exception Value: DatabaseWrapper objects created in a thread can only be used in that s...
8.
[django] Exception Value: DatabaseWrapper objects created in a thread can only be used in that same
9.
The type OneInterface cannot be a superinterface of OneInterfaceImpl; a superinterface must be an in
10.
Codelab for Android Design Support Library used in I/O Rewind Bangkok session
>>更多相關文章<<