Commit 92c8e085 authored by Mygod's avatar Mygod

Hide adview if default profile is no longer active

parent a5ef0cd6
......@@ -450,13 +450,13 @@ class Shadowsocks
private def updatePreferenceScreen() {
val profile = currentProfile
if (profile.host == "198.199.101.152" && adView == null) {
if (profile.host == "198.199.101.152") if (adView == null) {
adView = new AdView(this)
adView.setAdUnitId("ca-app-pub-9097031975646651/7760346322")
adView.setAdSize(AdSize.SMART_BANNER)
preferences.getView.asInstanceOf[ViewGroup].addView(adView, 0)
adView.loadAd(new AdRequest.Builder().build())
}
} else adView.setVisibility(View.VISIBLE) else if (adView != null) adView.setVisibility(View.GONE)
preferences.update(profile)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment