I have ArrayList
where I am adding a custom list that is displayed in a ListView
. What I need is to pass the value of the selected item to another screen.
See below the method that will call the other screen:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Object obj = parent.getItemAtPosition(position);
System.out.println(obj);
Intent it = new Intent(this, ActHolerite.class);
startActivityForResult(it, 0);
}
In the above method I have the following return (in System.out
):
I / System.out: {tipcal = Monthly Calculation, perref = April / 2015, codcal = 405}
What I need to pass to another screen is just the 405 (relative to codcal=405
) because it is a key field of a select that I will use on this other screen.
How can I " disassemble " this string and just get the number 405 ?