i create a cursoradapter that will use two different layouts depending on
"direction" field in the cursor.
this is the code
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
holder = new ViewHolder();
if(cursor.getInt(cursor.getColumnIndex("direction"))==0) {
v = mInflater.inflate(R.layout.layout1, parent, false);
} else {
v= mInflater.inflate(R.layout.layout2, parent, false);
}
holder.text = (TextView) v.findViewById(R.id.text);
.
.
.
.
.
v.setTag(holder);
return v;
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
String text=cursor.getString(cursor.getColumnIndex("text")
.
.
.
Data data=new Data(text..........)
holder = (ViewHolder) view.getTag();
if(cursor.getInt(cursor.getColumnIndex("direction"))==0) {
view=managelayout1(data,holder)
else
view=managelayout2(data,holder);
}
the problem it is that after scrolling the layouts change postions data1
appear in layout2 and data2 appear in layout1 randomly
if the facing items content the 2 differents layout if have one layout so
all the other data will appear in the same layout
it is there any way to save the postion of layout
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en