i am making google ads and facebook ads in android studio using alternative if else condtions. i have taken data from shared prefernce. my concept is first time fb condition should get load and then it will get destroyed and after that google condition will get load in application.. but issue is only one condition is getting load. i hope i m clear with quetsions.any help is much appreciated. below is my code.
SharedPreferences preferences = getSharedPreferences("ScreenMirror", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
// editor.putBoolean("defult",false);
editor.apply();
google=preferences.getBoolean("defult", true);
if (google==true) {
Toast.makeText(this, "Google Ads", Toast.LENGTH_SHORT).show();
Log.d("TAG1111", "onCreate() returned: " + google);
google=false;
Log.d("TAG1111", "onCreate() returned: " + google);
}else {
Toast.makeText(this, "facebook Ads", Toast.LENGTH_SHORT).show();
google=true;
}
Aucun commentaire:
Enregistrer un commentaire