Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio doesn't see ArrayList class

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;
    }
}
like image 335
max_dev Avatar asked Nov 02 '22 03:11

max_dev


1 Answers

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.

like image 85
leonz Avatar answered Nov 11 '22 12:11

leonz