I have a button to which I gave a setOnClickListener in the onCreate estor receiving an intent that has an arrayList and the array list is updated when I add more images. I want to finish the life cycle of the app but it is not staying. When I add more images I select the btnPicture button then it sends me to another activity where in this activity I have the cancel in case I no longer want to upload or select but if I cancel it I call Class.superonBackPressed to return to the activity but when come back, the activity is destroyed.
btnHome.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();//./<------------------------CHECAR
Intent intentMain = new Intent(IndexActivity.this, MainActivity.class);//creo un intent
startActivity(intentMain);//inicio la actividad
}//./OnClick
});//./OnClickLIstener
btnPicture.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intentPicture = new Intent(IndexActivity.this, PictureActivity.class);//creo un intent
intentPicture.putExtra("arrayImages", listOfImages);//le paso el arreglo como parametro
startActivity(intentPicture);//inicio la actividad
finish();//./<------------------------CHECAR
}//./OnClick
});//./OnClickListener