Edit, edit, edit, OH FOR THE LOVE OF GOD, EDIIIIT!
One of the most frustrating aspects of trying to track down a solution to a problem online is the mountain of dated answers you must wade through, usually without any clear indication that they are, in fact, obsolete.
Your example is a prime example of this problem: how irritated would you be, if you found the question, followed the advice in the top answer, only to find out later that you'd missed a much, much easier solution further down the page? I've edited this to indicate the historical nature of the technique and point out the new answer. Note that while Matthew is correct in noting that edits which fundamentally change the meaning of an answer are discouraged, this is meant more to avoid controversy - if an answer was once correct, editing to make it correct again does, in a sense, preserve that intent.
A more interesting scenario might involve an answer that becomes incorrect in a new version of the OS. Since not everyone will be able to upgrade, you'll want to preserve the original answer... But you'll also want to clearly note that it only applies to specific releases. If you want to go the extra mile and compile a comprehensive, "Here's how to accomplish X in every Android version" answer, that's even better.
Note that editing does not preclude also answering. If a substantial amount of new information is required to provide an up-to-date answer, posting this separately can be much cleaner than trying to cram it into an existing answer. It's a judgement call, really - but in no event should you quietly ignore an incorrect answer just to make your own look better - edit, down-vote, comment, or flag (in that order) as needed to ensure it isn't left as a stumbling block for future readers.
If an answer is incorrect, unhelpful, or even just mediocre compared to other answers on the question, please down-vote it. And also up-vote the more useful answer(s). In the absence of an "accepted" answer, this will change the default sort order to put the more helpful answers nearer to the question and the top of the page.
Flag for moderator attention
If you see an "accepted" answer (green checkmark to the left, pinned directly below the question) that is flat-out incorrect, and for whatever reason are not able to edit it to correct the problem... Then leave a detailed comment describing the issue (and ideally linking to a correct answer) and then leave a flag notifying a moderator. When necessary, moderators can delete accepted answers, something even the owner of the answer cannot do... In order for this to happen, it should be obvious that the answer is, in fact, incorrect and uncorrectable - don't assume moderators are familiar with the subtleties of the topic being answered, give them the information they need to make that call.