Is there something wrong with this?

public void atualizaNota (ListView lista) {
> SQLiteDatabase db = null;
> ArrayAdapter<String> results = null;
> Cursor r;
> try {
> db = openOrCreateDatabase("base.db", MODE_PRIVATE, null);
> } catch (SQLException e) {
> AlertDialog.Builder err = new AlertDialog.Builder(principal.this);
> err.setTitle("Erro");
> err.setMessage(e.getMessage());
> err.setNeutralButton("Ok", null);
> err.show();
> return;
> }
> r = db.query("Notas", (new String[] {"Nota"}), null, null, null, null,
> null);
> r.moveToFirst();
> if (r.getCount()==0) {
> results.add("Nenhuma anotação encontrada");
> } else {
> int i = 1;
> while (i < r.getCount()) {
> results.add(r.getString(0));
> r.moveToNext();
> i++;
> }
> }
> lista.setAdapter(results);
> return;
> }


-- 
Thx. Jorge.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to