Dear all,
I have started learning of making extensions last week.
I am successful in making small extensions like mathematical functions.
Now i want to make dynamic components and append different functions to their events.
I implemented the following code and created a button in runtime successfully.
package io.Testing;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.common.*;
@DesignerComponent(version = 1,
description = "Testing",
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = "images/extension.png")
@SimpleObject(external = true)
public class Testing extends AndroidNonvisibleComponent {
private ComponentContainer container;
public Testing(ComponentContainer container) {
super(container.$form());
this.container = container;
}
@SimpleFunction(description="Add a new button.")
public void AddButton(){
Button myButton = new Button(container);
myButton.Text("New Button");
}
}
Now i want to implement Click event to this button.
Please help me in doing this.
Waiting for quick replies.
Thank you.
Hema Srinivas
@Automate_MyProject
India.