I added some UI elements to the main.xml file in the res\layout folder and when I try to access them through the call, R.layout.my_uielement
, the UI element that I created is not there. Even when I add a new xml file with UI elements, it still doesn't show up in the R.layout
class. I have made checked the ids on them and they have the correct format (I think): android:id="@+id/my_button"
. What could be the problem? Do I need to compile the code first?
UPDATE:
I have already tried adb kill-server
then adb start-server
. It doesn't seem to help. I have also tried R.id.my_uielement
, it doesn't register either.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
None of these worked for me! The only way i can access an
@+id/foo
is bymyPackage.R.id.foo
.This may not be the case for you, but sometimes when I use something from the android.R package (default android resources) and I use it in my class before making reference to anything from my own resource package, Eclipse adds the
import android.R;
statement in my imports. This will conflict with the default behavior of implicitly looking in your package's resources.Check your import statements for
import Android.R;
. If it's there, remove it. And, if you're using anything from android.R, fully qualify it when you use it in code.