It's not a secret anymore!*
The moose likes Android and the fly likes how we can add two different lists with separator between the two???  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "how we can add two different lists with separator between the two???  " Watch "how we can add two different lists with separator between the two???  " New topic
Author

how we can add two different lists with separator between the two???

neelima kant
Greenhorn

Joined: Sep 17, 2010
Posts: 20
private class MyListAdapter extends BaseAdapter {
public MyListAdapter(Context context) {
mContext = context;
}

public int getCount() {
return mStrings.length;
}

@Override
public boolean areAllItemsEnabled() {
return false;
}

@Override
public boolean isEnabled(int position) {
return !mStrings[position].startsWith("-");
}

public Object getItem(int position) {
return position;
}

public long getItemId(int position) {
return position;
}

public View getView(int position, View convertView, ViewGroup parent) {
TextView tv;
if (convertView == null) {
tv = (TextView) LayoutInflater.from(mContext).inflate(
android.R.layout.simple_expandable_list_item_1, parent, false);
} else {
tv = (TextView) convertView;
}
tv.setText(mStrings[position]);
return tv;
}

private Context mContext;
}
 
 
subject: how we can add two different lists with separator between the two???
 
Similar Threads
listview with checkbox problem
How to display Images stored on sdcard?
How to Create two parallel listViews where each list view contains a text and a icon
styling items of a ListView
How to add text to gridview