Mighty all, I'm new to android and look for help or suggestions here.
An idea I'm trying to implement is: loop through elements of a list, displaying and waiting to hear back from different activities depending on a particular value an element has.
What I thought would work:
for (Model item:questionBank) {
if (item.getTaskType() == "taskType1") {
Intent intent = new Intent(MainActivity.this, 2ndactivity.class);
intent.putExtra("word", item.getWord());
startActivityForResult(intent,REQUEST_CODE);
}}
plus an override method onActivityResult later in the code.
What happens is application starts the activity but it also continues looping though elements without waiting for started activity to finish...
Is it possible to make it wait for started activity to finish before moving on ?
Thank you for sharing your thoughts in advance!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…