Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Im working with FTP4J java api and android in eclipse.
- I am a newbie.
- I am trying to populate a ListView with some files of the working directory on an ftp server.
- FTPClient client;
- FTPFile[] list;
- client.connect("100.100.100.100");
- client.login(usernamestring, passwordstring);
- list = client.list(); //this line returns the files in the current directory
- String lv_arr[]={list[0].getname(),list[1].getname(),list[2].getname()}; //this is where the program crashes
- final ListView filelist = (ListView) findViewById(R.id.ListView01);
- filelist.setAdapter(new ArrayAdapter<String>(ftpclientbasic.this,
- android.R.layout.simple_list_item_1, lv_arr));
- The program always crashes when I try to populate the string array with some elements of the FTPList object.
- If i populate the string array manually with String lv_arr[]={"example","example"} it works fine, i see "example example" in the list view. Where am i going wrong?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement