6
I have a ArrayList
where I assemble a custom list that is displayed on 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 return below (in the System.out
):
I/System.out {tipcal=Monthly Calculation, perref=April / 2015, codcal=405}
What I need to move to another screen is just the 405 (concerning the codcal=405
) because it is a key field of a select that I will use on this other screen.
How can I "dismantle" that string and take only the number 405?
Very good... Thank you very much Bruno!
– Fábio Azevedo
Dispo @Fábioazevedo. If it has been helpful, consider accepting the answer :)
– Bruno César