Nếu tôi gặp lỗi "android.content.res.Resources $ NotFoundException: ID tài nguyên # 0x7f050007 loại # 0x12 không hợp lệ", tôi có thể tìm một số tài nguyên này là gì nếu tôi biết ID?Android tìm tài nguyên theo id trong thời gian chạy
ListView list = (ListView)findViewById(R.id.messages_list_view);
list.setAdapter(new ArrayAdapter<String>(context,
R.layout.messages_list, headers));
messages_list.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/messages_list_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ListView android:id="@+id/messages_list_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
Hãy gửi nguồn. –
Bạn có nghĩa là bạn không sử dụng R.id? Bạn có thể gợi ý cho tôi lý do tại sao? –
mà không biết bạn đã cố gắng triển khai điều gì, chúng tôi có thể đề xuất như thế nào? –