0
I have an application that at a certain time the user will list the contents of the folder containing some pdf’s that will be opened from this listing, however I can’t list the contents of the folder
package com.app.login_basic;
import android.app.ListActivity;
import android.os.Bundle;
import android.os.Environment;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class OpenFilePDF extends ListActivity {
ListView listview;
private File file;
private List<String> minhaLista;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_openfile);
listview = findViewById(R.id.lv);
//prencher a lista de um adapter
minhaLista = new ArrayList<String>();
String root_sd =
Environment.getExternalStorageDirectory().toString();
file = new File(root_sd + "/pdf");
File list[] = file.listFiles();
for (int i = 0; i < list.length; i++) {
minhaLista.add(list[i].getName());
}
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, minhaLista));
}
}
I saw in chat that this model passed above has to make modifications, IE, was passed as an Abstract model, which only serves to illustrate the use.
– user3873165
https://chat.stackexchange.com/rooms/20581/discussion-between-war-lock-and-lollipop ...I didn’t change anything at the end 
instead of the arrayadapter
– user3873165
I put it as I thought it was right, it also says here: https://stackoverflow.com/questions/32598489/list-view-asset-folders
– user3873165
all options I have lead me to error: Cannot resolve method 'setListAdapter(android.widget.Simpleadapter)'
– user3873165
updated extends to extend his class but it didn’t even work.
– user3873165