Reputation: 876
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 their userid and the number 1 to the database. My app then receives that number and adds the relevant reward. But let's 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 official counting method I have set up.
Is there a way to say if the number is higher than the one in the official counting method do nothing?
This is my simple code:
}else
if (counter == 1) {
mRewards.mstreaming.setBackground( mcontext.getResources().getDrawable(R.drawable.buttonbkground2) );
If it already = 2 I don't want it to go back to the above.
Upvotes: 0
Views: 62
Reputation: 11
To do nothing you can just use return.
if(/*number>your counting method*/)return;
Upvotes: 1