samedi 1 juillet 2017

how do i stop a number from being lower in an if statement

please dont mark me down for this one guys as im a bit un sure how to even ask the question.

in my app i have a reward system. it uses firebase database to release the rewards.

for example if a user downloads 2 items and watches a short advert it registers there userid and the number 1 to the database. my app then receives that number and adds the relevant reward. but lets say i add the number 2 manually to my database for a prize for a competition or something similar.. it does add the reward. but then if they download another item it cancels the reward and goes back to the number set by the offical counting method i have set up..

is there a way to say if the number is higher than the one in the offical counting method do nothing? i know this is confusing lol and im sorry in advance

this is my simple code

 }else
    if (counter == 1) {
        mRewards.mstreaming.setBackground( mcontext.getResources().getDrawable(R.drawable.buttonbkground2) );

if it already = 2 i dont want it to go back to the above

Aucun commentaire:

Enregistrer un commentaire