tabrej-khan / android-unused-resources

Automatically exported from code.google.com/p/android-unused-resources
0 stars 0 forks source link

Gives false positives for unused id's in a file with RelativeLayout, where id is referenced by other items in the same layout using android:layout_below #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. AndroidUnusedResources1.6.2.jar against the attached file.

What is the expected output? What do you see instead?
No false positives

What version of the product are you using? On what operating system?
Version 1.6.2 on Mac OSX 10.7.4

Please provide any additional information below.
When run against attached file, I get the following false positives:

4 unused resources were found:
id        : addedit_titlebar
    /Users/gmanish/sources/noteit.android/res/layout/add_edit_item_view.xml
id        : addedit_updowncontrol
    /Users/gmanish/sources/noteit.android/res/layout/add_edit_item_view.xml
id        : iv_icon
id        : layout_price
    /Users/gmanish/sources/noteit.android/res/layout/add_edit_item_view.xml

Each of these id's are referenced in the same file using the attribute 
android:layout_below

Original issue reported on code.google.com by gman...@gmail.com on 4 Jul 2012 at 9:52

Attachments:

GoogleCodeExporter commented 9 years ago
android:layout_below="@+id/addedit_titlebar"
should be
android:layout_below="@id/addedit_titlebar"

You only use @+id when you're declaring an id, not when you're referencing one.

Original comment by skenned...@gmail.com on 4 Jul 2012 at 11:52

GoogleCodeExporter commented 9 years ago
Ah, sorry for the false positive bug report. 

Original comment by gman...@gmail.com on 4 Jul 2012 at 4:29