android - if/else type statements within java -


i trying determine upon startup whether in-app has been purchased, current code;

if (!(getsharedpreferences("purchased", 0).getboolean("purchased", false))) admob();         log.d("not upgraded", "show ad upgraded already"); if (!(getsharedpreferences("purchased", 0).getboolean("purchased", true))) admobskip();     log.d("upgraded", "do not show ad upgraded already"); 

but appears run through code, rather checking, ios use if / else , seem unable use , wanted java equivelent piece of code if possible? have swapped purchased 'true' on second half of statement.

use instead

if (getsharedpreferences("purchased", 0).getboolean("purchased",false) == false) {    admob();            log.d("not upgraded", "show ad upgraded already"); } else if (getsharedpreferences("purchased", 0).getboolean("purchased",true) == true) {    admobskip();        log.d("upgraded", "do not show ad upgraded already"); } 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -