I think you should try updating your Android Studio. 0.5.1 is really old and AFAIK, earlier versions were filled with bugs. Newer versions are much better, but still there are bugs.
Otherwise, there is nothing wrong with your code regarding ArrayList.