@Override public void onCreate(Bundle icicle) { // Called when the activity is first created super.onCreate(icicle); // Figure out the name of this form. String className = getClass().getName(); int lastDot = className.lastIndexOf('.'); formName = className.substring(lastDot + 1); Log.d(LOG_TAG, "Form " + formName + " got onCreate"); activeForm = this; Log.i(LOG_TAG, "activeForm is now " + activeForm.formName); viewLayout = new LinearLayout(this, ComponentConstants.LAYOUT_ORIENTATION_VERTICAL); defaultPropertyValues(); // Get startup text if any before adding components Intent startIntent = getIntent(); if (startIntent != null && startIntent.hasExtra(ARGUMENT_NAME)) { startupValue = startIntent.getStringExtra(ARGUMENT_NAME); } // // kludge: This is special to NearField and needs to be fixed // IntentFilter filter = new IntentFilter(); // filter.addAction(NearField.TELL_NEARFIELD_COMPONENT); // registerReceiver(myreceiver, filter); // Add application components to the form $define(); // Special case for Event.Initialize(): all other initialize events are triggered after // completing the constructor. This doesn't work for Android apps though because this method // is called after the constructor completes and therefore the Initialize event would run // before initialization finishes. Instead the compiler suppresses the invocation of the // event and leaves it up to the library implementation. Initialize(); }
// This is called from clear-current-form in runtime.scm. public void clear() { viewLayout.getLayoutManager().removeAllViews(); // Set all screen properties to default values. defaultPropertyValues(); screenInitialized = false; }