MCPcopy Create free account
hub / github.com/EXALAB/AnLinux-App / onCreate

Method onCreate

AnLinux/app/src/main/java/exa/lnx/a/MainUI.java:91–251  ·  view source on GitHub ↗
(Bundle savedInstanceState)

Source from the content-addressed store, hash-verified

89 boolean isDialogShowing = false;
90
91 @Override
92 protected void onCreate(Bundle savedInstanceState) {
93 SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
94 super.onCreate(savedInstanceState);
95 setContentView(R.layout.main_ui);
96
97 context = getApplicationContext();
98
99 new Thread(
100 () -> {
101 // Initialize GMA Next-Gen SDK on a background thread.
102 MobileAds.initialize(
103 this,
104 // Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713
105 new InitializationConfig.Builder("ca-app-pub-5748356089815497~5704037803")
106 .build(),
107 initializationStatus -> {
108 // Adapter initialization is complete.
109 });
110 // SDK initialization is complete. If you don't want to wait for bidding adapters to
111 // finish initializing, start loading ads now.
112 })
113 .start();
114
115 sharedPreferences = context.getSharedPreferences("GlobalPreferences", 0);
116 editor = sharedPreferences.edit();
117
118 shouldShowAds = sharedPreferences.getBoolean("ShouldShowAds", false);
119 isOreoNotified = sharedPreferences.getBoolean("IsOreoNotified", false);
120 isFirstBugNotified = sharedPreferences.getBoolean("IsFirstBugNotified", false);
121
122 final long splashDelay = 3500;
123 final long startTime = System.currentTimeMillis();
124 if(isOreoNotified){
125 splashScreen.setKeepOnScreenCondition(
126 () -> {
127 long elapsed = System.currentTimeMillis() - startTime;
128 return elapsed < splashDelay;
129 });
130 }else{
131 splashScreen.setKeepOnScreenCondition(() -> false);
132 showFirstDialog();
133 isDialogShowing = true;
134 }
135 splashScreen.setOnExitAnimationListener(splashScreenview ->{
136 appOpenAdManager.loadAd(MainUI.this);
137 splashScreenview.remove();
138 });
139
140 frameLayout = findViewById(R.id.ad_view_container);
141
142 mAdView = new AdView(this);
143 frameLayout.addView(mAdView);
144
145 appOpenAdManager = new AppOpenAdManager();
146
147 Toolbar toolbar = findViewById(R.id.toolbar);
148

Callers

nothing calls this directly

Calls 4

showFirstDialogMethod · 0.95
donationInstalledMethod · 0.95
newFragmentMethod · 0.95
loadAdMethod · 0.45

Tested by

no test coverage detected