324 lines
No EOL
25 KiB
HTML
324 lines
No EOL
25 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>Lint Report</title>
|
|
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto"><link rel="stylesheet" type="text/css" href="lint-results_files/hololike.css">
|
|
<script language="javascript">
|
|
<!--
|
|
function reveal(id) {
|
|
if (document.getElementById) {
|
|
document.getElementById(id).style.display = 'block';
|
|
document.getElementById(id+'Link').style.display = 'none';
|
|
}
|
|
}
|
|
//-->
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1>Lint Report<div class="titleSeparator"></div>
|
|
</h1>
|
|
Check performed at Mon Dec 30 02:13:10 CET 2013.<br/>0 errors and 8 warnings found:<br/><br/><table class="overview">
|
|
<tr><td></td><td class="categoryColumn"><a href="#Security">Security</a>
|
|
</td></tr>
|
|
<tr>
|
|
<td class="countColumn">2</td><td class="issueColumn"><img border="0" align="top" src="lint-results_files/lint-warning.png" />
|
|
<a href="#ExportedService">ExportedService: Exported service does not require permission</a>
|
|
</td></tr>
|
|
<tr><td></td><td class="categoryColumn"><a href="#Performance">Performance</a>
|
|
</td></tr>
|
|
<tr>
|
|
<td class="countColumn">6</td><td class="issueColumn"><img border="0" align="top" src="lint-results_files/lint-warning.png" />
|
|
<a href="#UnusedResources">UnusedResources: Unused resources</a>
|
|
</td></tr>
|
|
<tr><td></td><td class="categoryColumn"><a href="#MissingIssues">Disabled Checks (11)</a>
|
|
</td></tr></table>
|
|
<br/>
|
|
<a name="Security"></a>
|
|
<div class="category"><a href="#" title="Return to top">Security</a><div class="categorySeparator"></div>
|
|
</div>
|
|
<a name="ExportedService"></a>
|
|
<div class="issue">
|
|
<div class="id"><a href="#" title="Return to top">ExportedService: Exported service does not require permission</a><div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="warningslist">
|
|
<span class="location"><a href="file:///home/felix/workspace/controldlna/AndroidManifest.xml">/home/felix/workspace/controldlna/AndroidManifest.xml</a>:43</span>: <span class="message">Exported service does not require permission</span><br /><pre class="errorlines">
|
|
<span class="lineno"> 40</span>
|
|
<span class="lineno"> 41</span> <service android:name="com.github.nutomic.controldlna.upnp.RemotePlayService" />
|
|
<span class="lineno"> 42</span>
|
|
<span class="lineno"> 43</span> <span class="errorspan"><service android:name="com.github.nutomic.controldlna.upnp.ProviderService"</span>
|
|
<span class="lineno"> 44</span> android:label="sample_media_route_provider_service"
|
|
<span class="lineno"> 45</span> android:process=":mrp">
|
|
</pre>
|
|
<span class="location"><a href="file:///home/felix/workspace/controldlna/AndroidManifest.xml">/home/felix/workspace/controldlna/AndroidManifest.xml</a>:43</span>: <span class="message">Exported service does not require permission</span><br /><pre class="errorlines">
|
|
<span class="lineno"> 40</span>
|
|
<span class="lineno"> 41</span> <service android:name="com.github.nutomic.controldlna.upnp.RemotePlayService" />
|
|
<span class="lineno"> 42</span>
|
|
<span class="lineno"> 43</span> <span class="errorspan"><service android:name="com.github.nutomic.controldlna.upnp.ProviderService"</span>
|
|
<span class="lineno"> 44</span> android:label="sample_media_route_provider_service"
|
|
<span class="lineno"> 45</span> android:process=":mrp">
|
|
</pre>
|
|
</div>
|
|
<div class="metadata">Note: This issue has an associated quickfix operation in Eclipse/ADT <img border="0" align="top" src="lint-results_files/lint-run.png" />
|
|
<br>
|
|
Priority: 5 / 10<br/>
|
|
Category: Security</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Checks for exported services that do not require permissions.</div>
|
|
<div class="explanation">
|
|
Exported services (services which either set <code>exported=true</code> or contain an intent-filter and do not specify <code>exported=false</code>) should define a permission that an entity must have in order to launch the service or bind to it. Without this, any application can use this service.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "ExportedService" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div>
|
|
<a name="Performance"></a>
|
|
<div class="category"><a href="#" title="Return to top">Performance</a><div class="categorySeparator"></div>
|
|
</div>
|
|
<a name="UnusedResources"></a>
|
|
<div class="issue">
|
|
<div class="id"><a href="#" title="Return to top">UnusedResources: Unused resources</a><div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="warningslist">
|
|
<span class="location"><a href="file:///home/felix/workspace/controldlna/res/values/dimens.xml">/home/felix/workspace/controldlna/res/values/dimens.xml</a>:4</span>: <span class="message">The resource R.dimen.activity_horizontal_margin appears to be unused</span><br /><pre class="errorlines">
|
|
<span class="lineno"> 1</span> <resources>
|
|
<span class="lineno"> 2</span>
|
|
<span class="lineno"> 3</span> <!-- Default screen margins, per the Android Design guidelines. -->
|
|
<span class="lineno"> 4</span> <dimen <span class="errorspan">name="activity_horizontal_margin">16dp</dimen></span>
|
|
<span class="lineno"> 5</span> <dimen name="activity_vertical_margin">16dp</dimen>
|
|
<span class="lineno"> 6</span>
|
|
</pre>
|
|
<ul></ul><button id="Location1DivLink" onclick="reveal('Location1Div');" />+ 1 Additional Locations...</button>
|
|
<div id="Location1Div" style="display: none">
|
|
Additional locations: <ul>
|
|
<li> <span class="location"><a href="file:///home/felix/workspace/controldlna/res/values-sw720dp-land/dimens.xml">/home/felix/workspace/controldlna/res/values-sw720dp-land/dimens.xml</a>:7</span>
|
|
</ul>
|
|
</div><br/><br/>
|
|
<span class="location"><a href="file:///home/felix/workspace/controldlna/res/values/dimens.xml">/home/felix/workspace/controldlna/res/values/dimens.xml</a>:4</span>: <span class="message">The resource R.dimen.activity_horizontal_margin appears to be unused</span><br /><pre class="errorlines">
|
|
<span class="lineno"> 1</span> <resources>
|
|
<span class="lineno"> 2</span>
|
|
<span class="lineno"> 3</span> <!-- Default screen margins, per the Android Design guidelines. -->
|
|
<span class="lineno"> 4</span> <dimen <span class="errorspan">name="activity_horizontal_margin">16dp</dimen></span>
|
|
<span class="lineno"> 5</span> <dimen name="activity_vertical_margin">16dp</dimen>
|
|
<span class="lineno"> 6</span>
|
|
</pre>
|
|
<ul></ul><button id="Location2DivLink" onclick="reveal('Location2Div');" />+ 1 Additional Locations...</button>
|
|
<div id="Location2Div" style="display: none">
|
|
Additional locations: <ul>
|
|
<li> <span class="location"><a href="file:///home/felix/workspace/controldlna/res/values-sw720dp-land/dimens.xml">/home/felix/workspace/controldlna/res/values-sw720dp-land/dimens.xml</a>:7</span>
|
|
</ul>
|
|
</div><br/><br/>
|
|
<span class="location"><a href="file:///home/felix/workspace/controldlna/res/values/dimens.xml">/home/felix/workspace/controldlna/res/values/dimens.xml</a>:5</span>: <span class="message">The resource R.dimen.activity_vertical_margin appears to be unused</span><br /><pre class="errorlines">
|
|
<span class="lineno"> 2</span>
|
|
<span class="lineno"> 3</span> <!-- Default screen margins, per the Android Design guidelines. -->
|
|
<span class="lineno"> 4</span> <dimen name="activity_horizontal_margin">16dp</dimen>
|
|
<span class="lineno"> 5</span> <dimen <span class="errorspan">name="activity_vertical_margin">16dp</dimen></span>
|
|
<span class="lineno"> 6</span>
|
|
<span class="lineno"> 7</span> </resources>
|
|
</pre>
|
|
<span class="location"><a href="file:///home/felix/workspace/controldlna/res/values/dimens.xml">/home/felix/workspace/controldlna/res/values/dimens.xml</a>:5</span>: <span class="message">The resource R.dimen.activity_vertical_margin appears to be unused</span><br /><pre class="errorlines">
|
|
<span class="lineno"> 2</span>
|
|
<span class="lineno"> 3</span> <!-- Default screen margins, per the Android Design guidelines. -->
|
|
<span class="lineno"> 4</span> <dimen name="activity_horizontal_margin">16dp</dimen>
|
|
<span class="lineno"> 5</span> <dimen <span class="errorspan">name="activity_vertical_margin">16dp</dimen></span>
|
|
<span class="lineno"> 6</span>
|
|
<span class="lineno"> 7</span> </resources>
|
|
</pre>
|
|
<span class="location"><a href="file:///home/felix/workspace/controldlna/res/values/strings.xml">/home/felix/workspace/controldlna/res/values/strings.xml</a>:8</span>: <span class="message">The resource R.string.pause appears to be unused</span><br /><pre class="errorlines">
|
|
<span class="lineno"> 5</span> <string name="title_route">Route</string>
|
|
<span class="lineno"> 6</span> <string name="title_server">Server</string>
|
|
<span class="lineno"> 7</span> <string name="play">Play</string>
|
|
<span class="lineno"> 8</span> <string <span class="errorspan">name="pause">Pause</string></span>
|
|
<span class="lineno"> 9</span> <string name="exit_renderer">Do you really want to exit the renderer? Playback will be stopped.</string>
|
|
<span class="lineno"> 10</span> <string name="previous">Previous</string>
|
|
</pre>
|
|
<span class="location"><a href="file:///home/felix/workspace/controldlna/res/values/strings.xml">/home/felix/workspace/controldlna/res/values/strings.xml</a>:8</span>: <span class="message">The resource R.string.pause appears to be unused</span><br /><pre class="errorlines">
|
|
<span class="lineno"> 5</span> <string name="title_route">Route</string>
|
|
<span class="lineno"> 6</span> <string name="title_server">Server</string>
|
|
<span class="lineno"> 7</span> <string name="play">Play</string>
|
|
<span class="lineno"> 8</span> <string <span class="errorspan">name="pause">Pause</string></span>
|
|
<span class="lineno"> 9</span> <string name="exit_renderer">Do you really want to exit the renderer? Playback will be stopped.</string>
|
|
<span class="lineno"> 10</span> <string name="previous">Previous</string>
|
|
</pre>
|
|
</div>
|
|
<div class="metadata">Priority: 3 / 10<br/>
|
|
Category: Performance</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for unused resources.</div>
|
|
<div class="explanation">
|
|
Unused resources make applications larger and slow down builds.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "UnusedResources" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div>
|
|
<a name="MissingIssues"></a>
|
|
<div class="category">Disabled Checks<div class="categorySeparator"></div>
|
|
</div>
|
|
The following issues were not run by lint, either because the check is not enabled by default, or because it was disabled with a command line flag or via one or more lint.xml configuration files in the project directories.
|
|
<br/><br/>
|
|
<a name="BackButton"></a>
|
|
<div class="issue">
|
|
<div class="id">BackButton<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 6 / 10<br/>
|
|
Category: Usability</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for Back buttons, which are not common on the Android platform.</div>
|
|
<div class="explanation">
|
|
According to the Android Design Guide,<br/>
|
|
<br/>
|
|
"Other platforms use an explicit back button with label to allow the user to navigate up the application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical navigation and the navigation bar's back button for temporal navigation."<br/>
|
|
This check is not very sophisticated (it just looks for buttons with the label "Back"), so it is disabled by default to not trigger on common scenarios like pairs of Back/Next buttons to paginate through screens.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <a href="http://developer.android.com/design/patterns/pure-android.html">http://developer.android.com/design/patterns/pure-android.html</a></div>
|
|
<br/>To suppress this error, use the issue id "BackButton" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="EasterEgg"></a>
|
|
<div class="issue">
|
|
<div class="id">EasterEgg<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 6 / 10<br/>
|
|
Category: Security</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for hidden easter eggs.</div>
|
|
<div class="explanation">
|
|
An "easter egg" is code deliberately hidden in the code, both from potential users and even from other developers. This lint check looks for code which looks like it may be hidden from sight.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "EasterEgg" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="FieldGetter"></a>
|
|
<div class="issue">
|
|
<div class="id">FieldGetter<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 4 / 10<br/>
|
|
Category: Performance</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Suggests replacing uses of getters with direct field access within a class.</div>
|
|
<div class="explanation">
|
|
Accessing a field within the class that defines a getter for that field is at least 3 times faster than calling the getter. For simple getters that do nothing other than return the field, you might want to just reference the local field directly instead.<br/>
|
|
<br/>
|
|
<b>NOTE</b>: As of Android 2.3 (Gingerbread), this optimization is performed automatically by Dalvik, so there is no need to change your code; this is only relevant if you are targeting older versions of Android.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <a href="http://developer.android.com/guide/practices/design/performance.html#internal_get_set">http://developer.android.com/guide/practices/design/performance.html#internal_get_set</a></div>
|
|
<br/>To suppress this error, use the issue id "FieldGetter" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="IconExpectedSize"></a>
|
|
<div class="issue">
|
|
<div class="id">IconExpectedSize<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 5 / 10<br/>
|
|
Category: Usability:Icons</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Ensures that launcher icons, notification icons etc have the correct size.</div>
|
|
<div class="explanation">
|
|
There are predefined sizes (for each density) for launcher icons. You should follow these conventions to make sure your icons fit in with the overall look of the platform.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <a href="http://developer.android.com/design/style/iconography.html">http://developer.android.com/design/style/iconography.html</a></div>
|
|
<br/>To suppress this error, use the issue id "IconExpectedSize" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="RtlCompat"></a>
|
|
<div class="issue">
|
|
<div class="id">RtlCompat<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 6 / 10<br/>
|
|
Category: Bi-directional Text</div>
|
|
Severity: <span class="error">Error</span><div class="summary">
|
|
Explanation: Looks for compatibility issues with RTL support.</div>
|
|
<div class="explanation">
|
|
API 17 adds a <code>textAlignment</code> attribute to specify text alignment. However, if you are supporting older versions than API 17, you must <b>also</b> specify a gravity or layout_gravity attribute, since older platforms will ignore the <code>textAlignment</code> attribute.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "RtlCompat" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="RtlEnabled"></a>
|
|
<div class="issue">
|
|
<div class="id">RtlEnabled<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 3 / 10<br/>
|
|
Category: Bi-directional Text</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for usages of right-to-left text constants without enabling RTL support.</div>
|
|
<div class="explanation">
|
|
To enable right-to-left support, when running on API 17 and higher, you must set the <code>android:supportsRtl</code> attribute in the manifest <code><application></code> element.<br/>
|
|
If you have started adding RTL attributes, but have not yet finished the migration, you can set the attribute to false to satisfy this lint check.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "RtlEnabled" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="RtlHardcoded"></a>
|
|
<div class="issue">
|
|
<div class="id">RtlHardcoded<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 5 / 10<br/>
|
|
Category: Bi-directional Text</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for hardcoded left/right constants which could be start/end for bidirectional text.</div>
|
|
<div class="explanation">
|
|
Using <code>Gravity#LEFT</code> and <code>Gravity#RIGHT</code> can lead to problems when a layout is rendered in locales where text flows from right to left. Use <code>Gravity#START</code> and <code>Gravity#END</code> instead. Similarly, in XML <code>gravity</code> and <code>layout_gravity</code> attributes, use <code>start</code> rather than <code>left</code>.<br/>
|
|
For XML attributes such as paddingLeft and <code>layout_marginLeft</code>, use <code>paddingStart</code> and <code>layout_marginStart</code>. <b>NOTE</b>: If your <code>minSdkVersion</code> is less than 17, you should add <b>both</b> the older left/right attributes <b>as well as</b> the new start/right attributes. On older platforms, where RTL is not supported and the start/right attributes are unknown and therefore ignored, you need the older left/right attributes. There is a separate lint check which catches that type of error.<br/>
|
|
(Note: For <code>Gravity#LEFT</code> and <code>Gravity#START</code>, you can use these constants even when targeting older platforms, because the <code>start</code> bitmask is a superset of the <code>left</code> bitmask. Therefore, you can use <code>gravity="start"</code> rather than <code>gravity="left|start"</code>.)
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "RtlHardcoded" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="SelectableText"></a>
|
|
<div class="issue">
|
|
<div class="id">SelectableText<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 7 / 10<br/>
|
|
Category: Usability</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for TextViews which should probably allow their text to be selected.</div>
|
|
<div class="explanation">
|
|
If a <code><TextView></code> is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the <code><TextView></code> should specify <code>android:textIsSelectable="true"</code>.<br/>
|
|
<br/>
|
|
This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically. This value will be ignored on platforms older than API 11, so it is okay to set it regardless of your <code>minSdkVersion</code>.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "SelectableText" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="StopShip"></a>
|
|
<div class="issue">
|
|
<div class="id">StopShip<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 10 / 10<br/>
|
|
Category: Correctness</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for comment markers of the form <code>//STOPSHIP</code> which indicates that code should not be released yet.</div>
|
|
<div class="explanation">
|
|
Using the comment <code>// STOPSHIP</code> can be used to flag code that is incomplete but checked in. This comment marker can be used to indicate that the code should not be shipped until the issue is addressed, and lint will look for these.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "StopShip" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="TypographyQuotes"></a>
|
|
<div class="issue">
|
|
<div class="id">TypographyQuotes<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Note: This issue has an associated quickfix operation in Eclipse/ADT <img border="0" align="top" src="lint-results_files/lint-run.png" />
|
|
<br>
|
|
Disabled By: Default<br/>
|
|
Priority: 5 / 10<br/>
|
|
Category: Usability:Typography</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for straight quotes which can be replaced by curvy quotes.</div>
|
|
<div class="explanation">
|
|
Straight single quotes and double quotes, when used as a pair, can be replaced by "curvy quotes" (or directional quotes). This can make the text more readable.<br/>
|
|
<br/>
|
|
Note that you should never use grave accents and apostrophes to quote, `like this'.<br/>
|
|
<br/>
|
|
(Also note that you should not use curvy quotes for code fragments.)
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <a href="http://en.wikipedia.org/wiki/Quotation_mark">http://en.wikipedia.org/wiki/Quotation_mark</a></div>
|
|
<br/>To suppress this error, use the issue id "TypographyQuotes" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div><a name="UnusedIds"></a>
|
|
<div class="issue">
|
|
<div class="id">UnusedIds<div class="issueSeparator"></div>
|
|
</div>
|
|
<div class="metadata">Disabled By: Default<br/>
|
|
Priority: 1 / 10<br/>
|
|
Category: Performance</div>
|
|
Severity: <span class="warning">Warning</span><div class="summary">
|
|
Explanation: Looks for unused id's.</div>
|
|
<div class="explanation">
|
|
This resource id definition appears not to be needed since it is not referenced from anywhere. Having id definitions, even if unused, is not necessarily a bad idea since they make working on layouts and menus easier, so there is not a strong reason to delete these.
|
|
</div>
|
|
<br/><div class="moreinfo">More info: <br/>To suppress this error, use the issue id "UnusedIds" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
|
</div>
|
|
<a name="SuppressInfo"></a>
|
|
<div class="category">Suppressing Warnings and Errors<div class="categorySeparator"></div>
|
|
</div>
|
|
Lint errors can be suppressed in a variety of ways:<br/><br/>1. With a @SuppressLint annotation in the Java code<br/>2. With a tools:ignore attribute in the XML file<br/>3. With a lint.xml configuration file in the project<br/>4. With a lint.xml configuration file passed to lint via the --config flag<br/>5. With the --ignore flag passed to lint.<br/><br/>To suppress a lint warning with an annotation, add a @SuppressLint("id") annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources" or {"UnusedResources","UnusedIds"}, or it can be "all" to suppress all lint warnings in the given scope.<br/><br/>To suppress a lint warning in an XML file, add a tools:ignore="id" attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android declaration:<br/>* xmlns:tools="http://schemas.android.com/tools"<br/><br/>To suppress lint warnings with a configuration XML file, create a file named lint.xml and place it at the root directory of the project in which it applies. (If you use the Eclipse plugin's Lint view, you can suppress errors there via the toolbar and Eclipse will create the lint.xml file for you.).<br/><br/>The format of the lint.xml file is something like the following:<br/><br/><?xml version="1.0" encoding="UTF-8"?><br/><lint><br/> <!-- Disable this given check in this project --><br/> <issue id="IconMissingDensityFolder" severity="ignore" /><br/><br/> <!-- Ignore the ObsoleteLayoutParam issue in the given files --><br/> <issue id="ObsoleteLayoutParam"><br/> <ignore path="res/layout/activation.xml" /><br/> <ignore path="res/layout-xlarge/activation.xml" /><br/> </issue><br/><br/> <!-- Ignore the UselessLeaf issue in the given file --><br/> <issue id="UselessLeaf"><br/> <ignore path="res/layout/main.xml" /><br/> </issue><br/><br/> <!-- Change the severity of hardcoded strings to "error" --><br/> <issue id="HardcodedText" severity="error" /><br/></lint><br/><br/>To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:<br/>"lint --ignore UnusedResources,UselessLeaf /my/project/path"<br/>
|
|
|
|
</body>
|
|
</html> |