mirror of https://github.com/M66B/NetGuard.git
Refactoring
This commit is contained in:
parent
a27b77fb2d
commit
bcba2783c8
|
@ -339,8 +339,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
||||||
registerReceiver(packageChangedReceiver, intentFilter);
|
registerReceiver(packageChangedReceiver, intentFilter);
|
||||||
|
|
||||||
// First use
|
// First use
|
||||||
boolean admob = prefs.getBoolean("admob", false);
|
if (!initialized) {
|
||||||
if (!initialized || !admob) {
|
|
||||||
// Create view
|
// Create view
|
||||||
LayoutInflater inflater = LayoutInflater.from(this);
|
LayoutInflater inflater = LayoutInflater.from(this);
|
||||||
View view = inflater.inflate(R.layout.first, null, false);
|
View view = inflater.inflate(R.layout.first, null, false);
|
||||||
|
@ -361,7 +360,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
if (running) {
|
if (running) {
|
||||||
prefs.edit().putBoolean("initialized", true).apply();
|
prefs.edit().putBoolean("initialized", true).apply();
|
||||||
prefs.edit().putBoolean("admob", true).apply();
|
initAds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -415,9 +414,6 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
||||||
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize ads
|
|
||||||
initAds();
|
|
||||||
|
|
||||||
// Handle intent
|
// Handle intent
|
||||||
checkExtras(getIntent());
|
checkExtras(getIntent());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue