@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFirst) {
processBA = new anywheresoftware.b4a.ShellBA(this.getApplicationContext(), null, null, "b4a.example", "b4a.example.automazioni");
processBA.loadHtSubs(this.getClass());
float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
BALayout.setDeviceScale(deviceScale);
}
else if (previousOne != null) {
Activity p = previousOne.get();
if (p != null && p != this) {
BA.LogInfo("Killing previous instance (automazioni).");
p.finish();
}
}
processBA.runHook("oncreate", this, null);
if (!includeTitle) {
this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
}
if (fullScreen) {
getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,
android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
mostCurrent = this;
processBA.sharedProcessBA.activityBA = null;
layout = new BALayout(this);
setContentView(layout);
afterFirstLayout = false;
BA.handler.postDelayed(new WaitForLayout(), 5);
}