1
I’m recreating one of my activitys to work with Action Bar, with a lot of help from Mr @Wakin I was able to make it work:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gerenciamento);
abrebanco();
buscardados();
gerelista();
//String[] tabelas = tab.toArray(new String[tab.size()]);
List<String> l = getgeraList();
ArrayAdapter<String> ad = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_2, android.R.id.text1, l);
ListView lv = (ListView) findViewById(R.id.list);
lv.setAdapter(ad);
}
private List<String> getgeraList() {
List<String> l = new ArrayList<String>();
cursor.moveToLast();
int x=cursor.getCount();
int y=0;
while(y<x){
//nextdado();
l.add(retornadado());
dadoanterior();
y++;
}
return l;
}
I need to return the content of what was written in the listview that was selected by the user.
the problem that the function:
lv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
error. also can’t get the contents of the list.
I could tell you what the mistake is?
– Danilo Oliveira
Activitythread.performLaunchActivity(Activitythread$Activityclientrecord, Intent) line: 2110
– Joannis
@Joannis This is not the error, it is the method where the error occurs. The error log comprises several lines of the logcat and must be pasted into the question itself (to do so edit the question and paste the log lines).
– Piovezan
does not roll more because I changed the program already and this working. thanks!
– Joannis