Cant make listview it said array null on android studio : i want to display contacts that i get from api using listview. but when i want to run it, it forced close. when i try to look the log that i made, the usernamefriendprofile array is null outside the response. otherwise,the usernamefriendprofile array had a value inside the response. if i put the array adapter in response it get an error like 

> Cannot resolve constructor 'ArrayAdapter(anonymous com.androidnetworking.interfaces JSONObject RequestListener, int, int, java.util.ArrayList<java.lang.String>)



    public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";
    private TextView username;
    public String tokenUser;
    public JSONObject namaTeman;
    public String namaUser;
    public JSONArray friends;
    private TextView usernameFriends;
    ArrayList<String> usernameFriendsProfile = new ArrayList<String>();
    ListView teman;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tokenUser= getIntent().getStringExtra("token");
        Log.d(TAG, "tokenmainactivity" + tokenUser); //untuk log pada onerror
        Log.d(TAG, "tokenhalamanselanjutnya " + tokenUser);
        username = (TextView) findViewById (R.id.user);
        usernameFriends = (TextView)findViewById(R.id.usernameTeman);
        teman=(ListView)findViewById(R.id.teman);
        initData();

        ArrayAdapter<String> arrayAdapter=new ArrayAdapter<String>(this,R.layout.activity_listview,R.id.usernameTeman,usernameFriendsProfile);
        teman.setAdapter(arrayAdapter);
        Log.d(TAG, "usernametemendiluar : " + usernameFriendsProfile);

    }




    public void initData() {
        //get user
        AndroidNetworking.get("http://10.0.2.2:3000/users")
                .addHeaders("Authorization","Bearer "+tokenUser)
                .setPriority(Priority.MEDIUM)
                .build()
                .getAsJSONObject(new JSONObjectRequestListener() {
                    @Override
                    public void onResponse(JSONObject response) {
                        Log.d(TAG, "onResponse: " + response); //untuk log pada onresponse
                        try {

                            JSONObject obj = new JSONObject(String.valueOf(response));
                            String usernameAkun = obj.getString("username");
                            username.setText(usernameAkun);
                            Log.d(TAG, "namaprofil : " + username);
                            JSONArray friends = obj.getJSONArray("friends");

                            for (int i=0;i<friends.length();i++)
                            {
                                JSONObject objek = friends.getJSONObject(i);
                                usernameFriendsProfile.add(objek.getString("username"));
                            }
                            Log.d(TAG, "usernametemendidalem : " + usernameFriendsProfile);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }

                    }

                    @Override
                    public void onError(ANError error) {
                        Log.d(TAG, "onError: Failed" + error); //untuk log pada onerror
                    }
                });
    }


    }

anyone know how to fix it ? thanks