Android Studio doesn't see ArrayList class

吃可爱长大的小学妹 提交于 2020-01-13 03:56:50

问题


Android Studio 0.5.1 doesn't see ArrayList class. Quick Definition suggest me create a new one. Even when I try to import java.util.ArrayList;

It works only if I set import java.util.*;, but Quick Definition still doesn't see.

import android.app.Activity;
import android.os.Bundle;
import java.util.*;
public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ArrayList<String> arrayList = new ArrayList<String>();
        ArrayList<Integer> i;
    }
}

回答1:


I think you should try upgrading your Android Studio. 0.5.1 is really old and AFAIK, earlier versions were filled with bugs. Newer versions are a lot better, but still some bugs.

Otherwise, there is nothing wrong with your code regarding ArrayList.



来源:https://stackoverflow.com/questions/22427891/android-studio-doesnt-see-arraylist-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!