开发者

binding [row,col] value to a textView

开发者 https://www.devze.com 2023-04-02 05:53 出处:网络
this is my first Android App. and I have problems with choosing the bes开发者_运维技巧t Adapter for my application

this is my first Android App. and I have problems with choosing the bes开发者_运维技巧t Adapter for my application I have table like the one drawn, I would like to bind specified rows of VALUE column to TextView my Question is : 1- how can I bind [row 1,col 3] to textView


_ID | NODE | Value


1 |link |google.com


2 | description |search

 MyDataBase mDB = new MyDataBase(this);
    Cursor cursor = mDB.all(this);

    String[] from = new String[] {mDB.VALUE};
    int[] to = new int[] {R.id.text1View1};

    SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.main, cursor, from,to );


you can use "view.setTag(Object)" , in your case the view is textview and the object will be a struct probably with row and column information.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号