Android app - delete item from list following an action in another activity -


I am creating an app where I display a list of pending challenges when the user clicks on the challenge, He can accept it or ignore it.

What do I want to do here and I do not know how:

  • If the user accepts or ignores the challenge, call it. And the challenge
  • If the back button is pressed, do nothing, the challenge is still visible

    In short, if the user actually responds to the challenge I do not want it to appear in the list, but if he does not select any option and presses the back button, then he has not selected one of the two functions, so I have to choose that list Is still the challenge to appear

    I do not think that when I want to return to my main activity, it is possible to find out which buttons I pressed. I have thought of using global variables, but I do not want to abuse them.

    Just to be clear, I am not asking how the list is removing the item but depending on the actions of any other activity, it is time to know when to delete one.

    index your second activity intending to remove it as a parameter and it is your first Within the activity, using Intent Extra (IntentI), again, return it as an index extra and then finish it and finish it. , Int, android.content.Intent))

    View 3.3. How to expand to get result data from sub-activity

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -