1
How do I get the Listview ID? Follow my shorthand code:
UPDATE
How do I get the REGISTRY ID that is populated by Sqlite in 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);
}
}
What do you mean by Listview ID? By the code posted is
R.id.lvObjetosEmprestados
– ramaral