0

i need to show the person name actually i show the id of person

 public void onViewBind(View view, Cursor cursor, ODataRow row) {
 OControls.setText(view, R.id.name, row.getString("person_id"));
  }

there are a relation manyToOne between class (sanction) and (ResPartner)

in this class(sanction) i put this code

public class Sanction extends OModel {
public static final String TAG = Sanction.class.getSimpleName();
public static final String AUTHORITY = "com.odoo.Etudiant";
 OColumn person_id = new OColumn("name", ResPartner.class, 
 OColumn.RelationType.ManyToOne);

he shows me the id of person but i need to show his name what can i do ?

Caludio
  • 135
  • 11

1 Answers1

0

try this

String[] rows = row.getString("person_id").spit(",");  
if(rows != null){
   if(rows[1] != null){
      String name = rows[1];
   }
}

Hope this will work for you

Normal1One
  • 219
  • 3
  • 11