List data in a List View

0

I'm studying programming for Android, I'm doing a query in the SQLite database, but I can not play the data obtained in a listview, it always returns my string in full instead of the bank's value.

This is my function that makes select

private boolean VerificaRegistro(){

        try{
        BancoDados = openOrCreateDatabase(NomeBanco, MODE_PRIVATE ,null);
        cursor = BancoDados.rawQuery("select * from tabcadastropessoa", null);

        if(cursor.getCount()!=0){
            cursor.getCount();
            cursor.moveToFirst();
            return true;
        }
        else
        {
        return false;
        }
        }catch(Exception erro){
        MensagemAlerta("Erro no Banco de Dados", "Não foi possível gverificar dados"
                + erro);
        return false;
        }
        finally{
            BancoDados.close();
        }
    }

This is my function to list in the listview

public void CarregaDados(){

        lista = (ListView)findViewById(R.id.LvMostraDados);
        VerificaRegistro();
            String[] Coluna = new String[]{"nomepessoa"};
            ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, 
                    Coluna);
            lista.setAdapter(adapter);
        }

This is the image of how the data returns me

    
asked by anonymous 28.05.2015 / 21:13

0 answers