Hi my android app has a listactivity this activity called from another activity with Intent , after calling in onCreate method of the ListActivity create a new AsynchTask and call web service and put all stuff into my ArrayList data come from web service is fine , but when i try to implement getView of the customArrayAdapter things get wierd , it sometimes show content of the list sometimes not or sometimes when i scroll.Here is my getView method of custom adapter. (Layout = textview + listView)
class EntryDetailsAdapter extends ArrayAdapter<Entry>{
private ArrayList<Entry> entryDetails;
private Entry tempEntry;
public EntryDetailsAdapter(Context context, int textViewResourceId,
List<Entry> objects) {
super(context, textViewResourceId, objects);
// TODO Auto-generated constructor stub
entryDetails = (ArrayList<Entry>) objects;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
View mView = convertView;
if(mView == null){
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mView = inflater.inflate(R.layout.entry_rows, null);
}
tempEntry = entryDetails.get(position);
//data is fine but problem is while occur while showing data
if(tempEntry != null){
//get the textview from list row xml that i defined
TextView textView = (TextView) findViewById(R.id.entryRowTextView);
if(textView != null){
//i dont know why but this sometimes giving null so check
textView.setText(tempEntry.getEntryContent());
}
}
return mView;
}
}
[NOTE] Problem might similar to this question but i couldnt find a solution