I’ve attached the Android source code via File > Project Structure > Modules > Dependencies > double-click the Android Platform > source path.
works for the most part, but in many classes in the source, IntelliJ is complaining about unresolved stuff, like variables it doesn’t know about it. Many times these vars are inherited from the superclass. Why can’t IntelliJ figure this out? It has no problem going to the declaration of the superclass and all other manner of navigation…
Android SDK doesn’t contain all the sources, in order to get them all you need to use some tricks like described in this blog post.
There are scripts that can build a single source jar from the Android Platform build tree like at the link above. If you read through the comments and links in that post you can find pre-built jars for different platforms that you can download and attach as Android SDK source in IntelliJ IDEA or Eclipse.