I am new to Android. I have some Products like a0, a1, a2. I want to add their definitions in the second line as x0, x1, x2.
Here is my main code:
private ListView lv;
ArrayAdapter<String> adapter;
ArrayList<HashMap<String, String>> productList;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_eagle);
String products[] = {"a0", "a1","a2", };
String definitions[] = {"x0", "x1","x2",};
lv = (ListView) findViewById(R.id.list_view);
inputSearch = (EditText) findViewById(R.id.inputSearch);
// Adding items to listview
adapter = new ArrayAdapter<String>(this, R.layout.list_item, R.id.product_name, products);
lv.setAdapter(adapter);
What I find:
a0
a1
a2
How can I find them in this way:
a0
x0
a1
x1
a2
x2
Thanks in advance.