How to do my own custom list? I mean, that each element of list will be looking like I want.
You can create an xml file which acts as an element that looks like you want.. and assign that to the list using inflators and adapters..
Try this.. http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/ , http://www.androidpeople.com/android-custom-listview-tutorial-example/
Create a custom list item row layout
You have to create a custom list row item in the layout folder, just like you define the usual activity layouts. There you place your icons, TextViews etc and place them properly.
Override the specific adapter you need
You then need to override the specific adapter you need in order to associate the data from your curso / object list with your layout xml element. This is usually done by overriding the getView
or bindView
method of the adapter of your choice (ResourceCursorAdapter, ArrayAdapter,..).
@Override
public View getView(int position, View convertView, ViewGroup parent){
if(convertView == null){
convertView = mInflater.inflate(R.layout.row_item, parent, false);
}
TextView someTextViewOnMyRowLayout = (TextView)findViewById(...);
someTextViewOnMyRowLayout.setText(...);
return convertView;
}