How do I get the ListView ID? Here is my summarized code:
UPDATE
How do I get the LOG ID that is populated by SQLite in the ListView.
public class MainActivity extends ActionBarActivity {
private SQLiteDatabase database;
private SimpleCursorAdapter dataSource;
private static final String[] campos = {"nomeObjeto", "nomePessoa", "_id"};
ListView listView;
BaseDAO helper;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView = (ListView) findViewById(R.id.lvObjetosEmprestados);
helper = new BaseDAO(this);
database = helper.getWritableDatabase();
AtualizarObjetos();
}
public void AtualizarObjetos(){
dataSource = new SimpleCursorAdapter(this, R.layout.objetosemprestadosrow, objetosEmprestados, campos, new int [] {R.id.lblNomeObjeto, R.id.lblEmprestadoPara});
listView.setAdapter(dataSource);
}
}