问题
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