The following code gives me a Lint warning (the yellow highlight with a suggestion for alternate code) on the “!=” stating basically that strings should be compared with .equals() instead of == or !=. When I modified the code to “!mRequestMap.get(target).equals(url)” I started getting some random fatal errors saying that it was attempting to invoke a method on a null object. It seems to run fine using the ==, but I’m assuming this has to do with capital and lowercase letters having different values and == not capturing that. Is there a different way I should convert this comparison, or just not worry about it?
mResponseHandler.post(new Runnable() {
@Override
public void run() {
if (mRequestMap.get(target) != url || mHasQuit) {
return;
}
mRequestMap.remove(target);
mTThumbnailDownloadListener.onThumbnailDownloaded(target, bitmap);
}
});