Lint Report

Check performed at Wed Oct 02 23:05:45 CEST 2013.
9 errors and 34 warnings found:

Correctness
3 MissingRegistered: Missing registered class
3 DefaultLocale: Implied default locale in case conversion
6 NewApi: Calling new methods on older versions
1 OldTargetApi: Target SDK attribute is not targeting latest version
3 SimpleDateFormat: Implied locale in date format
Performance
6 Overdraw: Overdraw: Painting regions more than once
Usability
3 TextFields: Missing inputType or hint
Internationalization
18 HardcodedText: Hardcoded text
Disabled Checks (11)

Correctness
MissingRegistered: Missing registered class
src/main/res/layout/last_hash_inner.xml:4: Class referenced in the layout file, org.ligi.androidhelper.views.SquareImageView, was not found in the project or the libraries
   1 <?xml version="1.0" encoding="utf-8"?>
   2 <merge xmlns:android="http://schemas.android.com/apk/res/android">
   3 
   4     <org.ligi.androidhelper.views.SquareImageView
   5             android:layout_width="match_parent"
   6             android:layout_height="wrap_content"
src/main/res/layout/last_hash_inner.xml:4: Class referenced in the layout file, org.ligi.androidhelper.views.SquareImageView, was not found in the project or the libraries
   1 <?xml version="1.0" encoding="utf-8"?>
   2 <merge xmlns:android="http://schemas.android.com/apk/res/android">
   3 
   4     <org.ligi.androidhelper.views.SquareImageView
   5             android:layout_width="match_parent"
   6             android:layout_height="wrap_content"
src/main/res/layout/last_hash_inner.xml:4: Class referenced in the layout file, org.ligi.androidhelper.views.SquareImageView, was not found in the project or the libraries
   1 <?xml version="1.0" encoding="utf-8"?>
   2 <merge xmlns:android="http://schemas.android.com/apk/res/android">
   3 
   4     <org.ligi.androidhelper.views.SquareImageView
   5             android:layout_width="match_parent"
   6             android:layout_height="wrap_content"
Priority: 8 / 10
Category: Correctness
Severity: Error
Explanation: Ensures that classes referenced in the manifest are present in the project or libraries.
If a class is referenced in the manifest, it must also exist in the project (or in one of the libraries included by the project. This check helps uncover typos in registration names, or attempts to rename or move classes without updating the manifest file properly.

More info: http://developer.android.com/guide/topics/manifest/manifest-intro.html

To suppress this error, use the issue id "MissingRegistered" as explained in the Suppressing Warnings and Errors section.
DefaultLocale: Implied default locale in case conversion
src/main/java/org/ligi/satoshiproof/ProofAsyncTask.java:73: Implicitly using the default locale is a common source of bugs: Use toLowerCase(Locale) instead
  70         progressDialog.dismiss();
  71         AlertDialog.Builder alertBuilder = new AlertDialog.Builder(context);
  72         alertBuilder.setPositiveButton("OK",new DialogDiscardingOnClickListener());
  73         if (s.toLowerCase().startsWith("never seen")) {
  74             alertBuilder.setMessage("The existence of this is not proven yet.");
  75             alertBuilder.setNeutralButton("Add Proof",new DialogInterface.OnClickListener() {
src/main/java/org/ligi/satoshiproof/ProofAsyncTask.java:73: Implicitly using the default locale is a common source of bugs: Use toLowerCase(Locale) instead
  70         progressDialog.dismiss();
  71         AlertDialog.Builder alertBuilder = new AlertDialog.Builder(context);
  72         alertBuilder.setPositiveButton("OK",new DialogDiscardingOnClickListener());
  73         if (s.toLowerCase().startsWith("never seen")) {
  74             alertBuilder.setMessage("The existence of this is not proven yet.");
  75             alertBuilder.setNeutralButton("Add Proof",new DialogInterface.OnClickListener() {
src/main/java/org/ligi/satoshiproof/ProofAsyncTask.java:73: Implicitly using the default locale is a common source of bugs: Use toLowerCase(Locale) instead
  70         progressDialog.dismiss();
  71         AlertDialog.Builder alertBuilder = new AlertDialog.Builder(context);
  72         alertBuilder.setPositiveButton("OK",new DialogDiscardingOnClickListener());
  73         if (s.toLowerCase().startsWith("never seen")) {
  74             alertBuilder.setMessage("The existence of this is not proven yet.");
  75             alertBuilder.setNeutralButton("Add Proof",new DialogInterface.OnClickListener() {
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Finds calls to locale-ambiguous String manipulation methods.
Calling String#toLowerCase() or #toUpperCase() without specifying an explicit locale is a common source of bugs. The reason for that is that those methods will use the current locale on the user's device, and even though the code appears to work correctly when you are developing the app, it will fail in some locales. For example, in the Turkish locale, the uppercase replacement for i is not I.

If you want the methods to just perform ASCII replacement, for example to convert an enum name, call String#toUpperCase(Locale.US) instead. If you really want to use the current locale, call String#toUpperCase(Locale.getDefault()) instead.

More info: http://developer.android.com/reference/java/util/Locale.html#default_locale

To suppress this error, use the issue id "DefaultLocale" as explained in the Suppressing Warnings and Errors section.
NewApi: Calling new methods on older versions
src/main/java/org/ligi/satoshiproof/LastHashActivity.java:28: Call requires API level 11 (current min is 7): android.app.ActionBar#setDisplayHomeAsUpEnabled
  25         aQuery = new AQuery(this);
  26         new FetchLastHashAsyncTask().execute();
  27         if (Build.VERSION.SDK_INT>=11) {
  28             getActionBar().setDisplayHomeAsUpEnabled(true);
  29         }
  30     }
src/main/java/org/ligi/satoshiproof/LastHashActivity.java:28: Call requires API level 11 (current min is 7): android.app.ActionBar#setDisplayHomeAsUpEnabled
  25         aQuery = new AQuery(this);
  26         new FetchLastHashAsyncTask().execute();
  27         if (Build.VERSION.SDK_INT>=11) {
  28             getActionBar().setDisplayHomeAsUpEnabled(true);
  29         }
  30     }
src/main/java/org/ligi/satoshiproof/LastHashActivity.java:28: Call requires API level 11 (current min is 7): android.app.ActionBar#setDisplayHomeAsUpEnabled
  25         aQuery = new AQuery(this);
  26         new FetchLastHashAsyncTask().execute();
  27         if (Build.VERSION.SDK_INT>=11) {
  28             getActionBar().setDisplayHomeAsUpEnabled(true);
  29         }
  30     }
src/main/java/org/ligi/satoshiproof/LastHashActivity.java:28: Call requires API level 11 (current min is 7): android.app.Activity#getActionBar
  25         aQuery = new AQuery(this);
  26         new FetchLastHashAsyncTask().execute();
  27         if (Build.VERSION.SDK_INT>=11) {
  28             getActionBar().setDisplayHomeAsUpEnabled(true);
  29         }
  30     }
src/main/java/org/ligi/satoshiproof/LastHashActivity.java:28: Call requires API level 11 (current min is 7): android.app.Activity#getActionBar
  25         aQuery = new AQuery(this);
  26         new FetchLastHashAsyncTask().execute();
  27         if (Build.VERSION.SDK_INT>=11) {
  28             getActionBar().setDisplayHomeAsUpEnabled(true);
  29         }
  30     }
src/main/java/org/ligi/satoshiproof/LastHashActivity.java:28: Call requires API level 11 (current min is 7): android.app.Activity#getActionBar
  25         aQuery = new AQuery(this);
  26         new FetchLastHashAsyncTask().execute();
  27         if (Build.VERSION.SDK_INT>=11) {
  28             getActionBar().setDisplayHomeAsUpEnabled(true);
  29         }
  30     }
Note: This issue has an associated quickfix operation in Eclipse/ADT 
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Finds API accesses to APIs that are not supported in all targeted API versions.
This check scans through all the Android API calls in the application and warns about any calls that are not available on all versions targeted by this application (according to its minimum SDK attribute in the manifest).

If you really want to use this API and don't need to support older devices just set the minSdkVersion in your AndroidManifest.xml file.
If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the @TargetApi annotation specifying the local minimum SDK to apply, such as @TargetApi(11), such that this check considers 11 rather than your manifest file's minimum SDK as the required API level.

If you are deliberately setting android: attributes in style definitions, make sure you place this in a values-v11 folder in order to avoid running into runtime conflicts on certain devices where manufacturers have added custom attributes whose ids conflict with the new ones on later platforms.

Similarly, you can use tools:targetApi="11" in an XML file to indicate that the element will only be inflated in an adequate context.

More info:
To suppress this error, use the issue id "NewApi" as explained in the Suppressing Warnings and Errors section.
src/main/AndroidManifest.xml:7: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.
   4           android:versionCode="4"
   5           android:versionName="0.4">
   6 
   7     <uses-sdk
   8             android:minSdkVersion="7"
   9             android:targetSdkVersion="16"/>
Severity: Warning
Explanation: Checks that the manifest specifies a targetSdkVersion that is recent.
When your application runs on a version of Android that is more recent than your targetSdkVersion specifies that it has been tested with, various compatibility modes kick in. This ensures that your application continues to work, but it may look out of place. For example, if the targetSdkVersion is less than 14, your app may get an option button in the UI.

To fix this issue, set the targetSdkVersion to the highest available value. Then test your app to make sure everything works correctly. You may want to consult the compatibility notes to see what changes apply to each version you are adding support for: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html


To suppress this error, use the issue id "OldTargetApi" as explained in the Suppressing Warnings and Errors section.
src/main/java/org/ligi/satoshiproof/ProofAsyncTask.java:83: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
  80             });
  81 
  82         } else {
  83             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  84             Date date=null;
  85             try {
src/main/java/org/ligi/satoshiproof/ProofAsyncTask.java:83: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
  80             });
  81 
  82         } else {
  83             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  84             Date date=null;
  85             try {
src/main/java/org/ligi/satoshiproof/ProofAsyncTask.java:83: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
  80             });
  81 
  82         } else {
  83             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  84             Date date=null;
  85             try {
Severity: Warning
Explanation: Using SimpleDateFormat directly without an explicit locale.
Almost all callers should use getDateInstance(), getDateTimeInstance(), or getTimeInstance() to get a ready-made instance of SimpleDateFormat suitable for the user's locale. The main reason you'd create an instance this class directly is because you need to format/parse a specific machine-readable format, in which case you almost certainly want to explicitly ask for US to ensure that you get ASCII digits (rather than, say, Arabic digits).

Therefore, you should either use the form of the SimpleDateFormat constructor where you pass in an explicit locale, such as Locale.US, or use one of the get instance methods, or suppress this error if really know what you are doing.


To suppress this error, use the issue id "SimpleDateFormat" as explained in the Suppressing Warnings and Errors section.
Performance
src/main/res/layout/last_hash.xml:11: Possible overdraw: Root element paints background @android:color/white with a theme that also paints a background (inferred theme is @style/AppTheme)
   8         android:paddingTop="@dimen/activity_vertical_margin"
   9         android:paddingBottom="@dimen/activity_vertical_margin"
  10         tools:context=".MainActivity"
  11         android:background="@android:color/white"
  12         android:orientation="vertical">
  13 
src/main/res/layout-land/last_hash.xml:11: Possible overdraw: Root element paints background @android:color/white with a theme that also paints a background (inferred theme is @style/AppTheme)
   8         android:paddingTop="@dimen/activity_vertical_margin"
   9         android:paddingBottom="@dimen/activity_vertical_margin"
  10         tools:context=".MainActivity"
  11         android:background="@android:color/white"
  12         android:orientation="horizontal">
  13 
src/main/res/layout/last_hash.xml:11: Possible overdraw: Root element paints background @android:color/white with a theme that also paints a background (inferred theme is @style/AppTheme)
   8         android:paddingTop="@dimen/activity_vertical_margin"
   9         android:paddingBottom="@dimen/activity_vertical_margin"
  10         tools:context=".MainActivity"
  11         android:background="@android:color/white"
  12         android:orientation="vertical">
  13 
src/main/res/layout-land/last_hash.xml:11: Possible overdraw: Root element paints background @android:color/white with a theme that also paints a background (inferred theme is @style/AppTheme)
   8         android:paddingTop="@dimen/activity_vertical_margin"
   9         android:paddingBottom="@dimen/activity_vertical_margin"
  10         tools:context=".MainActivity"
  11         android:background="@android:color/white"
  12         android:orientation="horizontal">
  13 
src/main/res/layout/last_hash.xml:11: Possible overdraw: Root element paints background @android:color/white with a theme that also paints a background (inferred theme is @style/AppTheme)
   8         android:paddingTop="@dimen/activity_vertical_margin"
   9         android:paddingBottom="@dimen/activity_vertical_margin"
  10         tools:context=".MainActivity"
  11         android:background="@android:color/white"
  12         android:orientation="vertical">
  13 
src/main/res/layout-land/last_hash.xml:11: Possible overdraw: Root element paints background @android:color/white with a theme that also paints a background (inferred theme is @style/AppTheme)
   8         android:paddingTop="@dimen/activity_vertical_margin"
   9         android:paddingBottom="@dimen/activity_vertical_margin"
  10         tools:context=".MainActivity"
  11         android:background="@android:color/white"
  12         android:orientation="horizontal">
  13 
Severity: Warning
Explanation: Looks for overdraw issues (where a view is painted only to be fully painted over)
If you set a background drawable on a root view, then you should use a custom theme where the theme background is null. Otherwise, the theme background will be painted first, only to have your custom background completely cover it; this is called "overdraw".

NOTE: This detector relies on figuring out which layouts are associated with which activities based on scanning the Java code, and it's currently doing that using an inexact pattern matching algorithm. Therefore, it can incorrectly conclude which activity the layout is associated with and then wrongly complain that a background-theme is hidden.

If you want your custom background on multiple pages, then you should consider making a custom theme with your custom background and just using that theme instead of a root element background.

Of course it's possible that your custom drawable is translucent and you want it to be mixed with the background. However, you will get better performance if you pre-mix the background with your drawable and use that resulting image or color as a custom theme background instead.

More info:
To suppress this error, use the issue id "Overdraw" as explained in the Suppressing Warnings and Errors section.
src/main/res/layout/activity_main.xml:33: This text field does not specify an inputType or a hint
  30             android:layout_height="wrap_content"
  31             android:layout_marginTop="20dp"
  32             />
  33     <EditText
  34             android:layout_width="match_parent"
  35             android:layout_height="wrap_content"
src/main/res/layout/activity_main.xml:33: This text field does not specify an inputType or a hint
  30             android:layout_height="wrap_content"
  31             android:layout_marginTop="20dp"
  32             />
  33     <EditText
  34             android:layout_width="match_parent"
  35             android:layout_height="wrap_content"
src/main/res/layout/activity_main.xml:33: This text field does not specify an inputType or a hint
  30             android:layout_height="wrap_content"
  31             android:layout_marginTop="20dp"
  32             />
  33     <EditText
  34             android:layout_width="match_parent"
  35             android:layout_height="wrap_content"
Severity: Warning
Explanation: Looks for text fields missing inputType or hint settings.
Providing an inputType attribute on a text field improves usability because depending on the data to be input, optimized keyboards can be shown to the user (such as just digits and parentheses for a phone number). Similarly,a hint attribute displays a hint to the user for what is expected in the text field.

The lint detector also looks at the id of the view, and if the id offers a hint of the purpose of the field (for example, the id contains the phrase phone or email), then lint will also ensure that the inputType contains the corresponding type attributes.

If you really want to keep the text field generic, you can suppress this warning by setting inputType="text".

More info:
To suppress this error, use the issue id "TextFields" as explained in the Suppressing Warnings and Errors section.
src/main/res/layout/activity_main.xml:14: [I18N] Hardcoded string "Proof existence of picture:", should use @string resource
  11         android:orientation="vertical">
  12 
  13     <TextView
  14             android:text="Proof existence of picture:"
  15             android:layout_width="wrap_content"
  16             android:layout_height="wrap_content"
src/main/res/layout/activity_main.xml:14: [I18N] Hardcoded string "Proof existence of picture:", should use @string resource
  11         android:orientation="vertical">
  12 
  13     <TextView
  14             android:text="Proof existence of picture:"
  15             android:layout_width="wrap_content"
  16             android:layout_height="wrap_content"
src/main/res/layout/activity_main.xml:14: [I18N] Hardcoded string "Proof existence of picture:", should use @string resource
  11         android:orientation="vertical">
  12 
  13     <TextView
  14             android:text="Proof existence of picture:"
  15             android:layout_width="wrap_content"
  16             android:layout_height="wrap_content"
src/main/res/layout/activity_main.xml:23: [I18N] Hardcoded string "select picture", should use @string resource
  20     <Button
  21             android:layout_width="wrap_content"
  22             android:layout_height="wrap_content"
  23             android:text="select picture"
  24             android:id="@+id/pickPictureButton"
  25             />
src/main/res/layout/activity_main.xml:23: [I18N] Hardcoded string "select picture", should use @string resource
  20     <Button
  21             android:layout_width="wrap_content"
  22             android:layout_height="wrap_content"
  23             android:text="select picture"
  24             android:id="@+id/pickPictureButton"
  25             />
Severity: Warning
Explanation: Looks for hardcoded text attributes which should be converted to resource lookup.
Hardcoding text attributes directly in layout files is bad for several reasons:

* When creating configuration variations (for example for landscape or portrait)you have to repeat the actual text (and keep it up to date when making changes)

* The application cannot be translated to other languages by just adding new translations for existing string resources.

In Eclipse there is a quickfix to automatically extract this hardcoded string into a resource lookup.

More info:
To suppress this error, use the issue id "HardcodedText" as explained in the Suppressing Warnings and Errors section.
Disabled Checks
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.

BackButton
Severity: Warning
Explanation: Looks for Back buttons, which are not common on the Android platform.
According to the Android Design Guide,

"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."
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.


To suppress this error, use the issue id "BackButton" as explained in the Suppressing Warnings and Errors section.
EasterEgg
Severity: Warning
Explanation: Looks for hidden easter eggs.
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.

More info:
To suppress this error, use the issue id "EasterEgg" as explained in the Suppressing Warnings and Errors section.
FieldGetter
Severity: Warning
Explanation: Suggests replacing uses of getters with direct field access within a class.
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.

NOTE: 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.


To suppress this error, use the issue id "FieldGetter" as explained in the Suppressing Warnings and Errors section.
IconExpectedSize
Severity: Warning
Explanation: Ensures that launcher icons, notification icons etc have the correct size.
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.


To suppress this error, use the issue id "IconExpectedSize" as explained in the Suppressing Warnings and Errors section.
RtlCompat
Severity: Error
Explanation: Looks for compatibility issues with RTL support.
API 17 adds a textAlignment attribute to specify text alignment. However, if you are supporting older versions than API 17, you must also specify a gravity or layout_gravity attribute, since older platforms will ignore the textAlignment attribute.

More info:
To suppress this error, use the issue id "RtlCompat" as explained in the Suppressing Warnings and Errors section.
RtlEnabled
Severity: Warning
Explanation: Looks for usages of right-to-left text constants without enabling RTL support.
To enable right-to-left support, when running on API 17 and higher, you must set the android:supportsRtl attribute in the manifest <application> element.
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.

More info:
To suppress this error, use the issue id "RtlEnabled" as explained in the Suppressing Warnings and Errors section.
RtlHardcoded
Severity: Warning
Explanation: Looks for hardcoded left/right constants which could be start/end for bidirectional text.
Using Gravity#LEFT and Gravity#RIGHT can lead to problems when a layout is rendered in locales where text flows from right to left. Use Gravity#START and Gravity#END instead. Similarly, in XML gravity and layout_gravity attributes, use start rather than left.
For XML attributes such as paddingLeft and layout_marginLeft, use paddingStart and layout_marginStart. NOTE: If your minSdkVersion is less than 17, you should add both the older left/right attributes as well as 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.
(Note: For Gravity#LEFT and Gravity#START, you can use these constants even when targeting older platforms, because the start bitmask is a superset of the left bitmask. Therefore, you can use gravity="start" rather than gravity="left|start".)

More info:
To suppress this error, use the issue id "RtlHardcoded" as explained in the Suppressing Warnings and Errors section.
SelectableText
Severity: Warning
Explanation: Looks for TextViews which should probably allow their text to be selected.
If a <TextView> is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the <TextView> should specify android:textIsSelectable="true".

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 minSdkVersion.

More info:
To suppress this error, use the issue id "SelectableText" as explained in the Suppressing Warnings and Errors section.
StopShip
Severity: Warning
Explanation: Looks for comment markers of the form //STOPSHIP which indicates that code should not be released yet.
Using the comment // STOPSHIP 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.

More info:
To suppress this error, use the issue id "StopShip" as explained in the Suppressing Warnings and Errors section.
TypographyQuotes
Severity: Warning
Explanation: Looks for straight quotes which can be replaced by curvy quotes.
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.

Note that you should never use grave accents and apostrophes to quote, `like this'.

(Also note that you should not use curvy quotes for code fragments.)


To suppress this error, use the issue id "TypographyQuotes" as explained in the Suppressing Warnings and Errors section.
UnusedIds
Severity: Warning
Explanation: Looks for unused id's.
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.

More info:
To suppress this error, use the issue id "UnusedIds" as explained in the Suppressing Warnings and Errors section.
Suppressing Warnings and Errors
Lint errors can be suppressed in a variety of ways:

1. With a @SuppressLint annotation in the Java code
2. With a tools:ignore attribute in the XML file
3. With a lint.xml configuration file in the project
4. With a lint.xml configuration file passed to lint via the --config flag
5. With the --ignore flag passed to lint.

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.

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:
* xmlns:tools="http://schemas.android.com/tools"

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.).

The format of the lint.xml file is something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable this given check in this project -->
<issue id="IconMissingDensityFolder" severity="ignore" />

<!-- Ignore the ObsoleteLayoutParam issue in the given files -->
<issue id="ObsoleteLayoutParam">
<ignore path="res/layout/activation.xml" />
<ignore path="res/layout-xlarge/activation.xml" />
</issue>

<!-- Ignore the UselessLeaf issue in the given file -->
<issue id="UselessLeaf">
<ignore path="res/layout/main.xml" />
</issue>

<!-- Change the severity of hardcoded strings to "error" -->
<issue id="HardcodedText" severity="error" />
</lint>

To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
"lint --ignore UnusedResources,UselessLeaf /my/project/path"