this is a project to shcool and im quiet new to this progamming world and i was trying to put some information into the textviews but this error don t let me "expected android.widget.textview but found java.lang.string" i dont know what more to do
//this the xml
LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/texto_1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/texto_2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/texto_3"/>
</LinearLayout>
this is the java
SQLiteDatabase db;
Cursor c;
String nota;
SimpleCursorAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notasver);
DB mDbHelper = new DB(this);
db = mDbHelper.getReadableDatabase();
Intent i = getIntent();
Bundle dados = i.getExtras();
nota = dados.getString(Contrato.Notas._ID, null);
mostrar();
}
public void mostrar()
{TextView nome = (TextView) findViewById(R.id.texto_1);
TextView descricao = (TextView) findViewById(R.id.texto_2);
TextView data_criacao = (TextView) findViewById(R.id.texto_3);
c = db.query(false, Contrato.Notas.TABLE_NAME, Contrato.Notas.PROJECTION, Contrato.Notas.COLUMN_ID_USER + "= ? ", new String[] {nota}, null,null,null,null);
nome = c.getString(c.getColumnIndex(Contrato.Notas.COLUMN_NOME));//error here
descricao = c.getString(c.getColumnIndex(Contrato.Notas.COLUMN_NOME));//error here
data_criacao = c.getString(c.getColumnIndex(Contrato.Notas.COLUMN_NOME));//error here
}