i want to set a button's onclick property.
here is my code
@SimpleFunction(description = "blah blah blah")
public String Getcomponent(AndroidViewComponent component){
i want to know what to code after this.
please help me
i want to set a button's onclick property.
here is my code
@SimpleFunction(description = "blah blah blah")
public String Getcomponent(AndroidViewComponent component){
i want to know what to code after this.
please help me
public class MyActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_layout_id);
final Button button = findViewById(R.id.button_id);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Code here executes on main thread after user presses button
}
});
}
}
sorry, but i didn't understand.
please complete my code
it's my humble request
Add a onclick listener to it
@SimpleFunction (description = "blah blah blah")
public void GetComponent(AndroidViewComponent component){
View view = component.getView();
view.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Your On Click Code
});
}
one more question , can i create public interfaces .
Please ask new questions in a new topic
okay, thanks
Unfortunately you can't access onCreate()
and use XML here.
Even if you somehow use onCreate() then you can expect to get a runtime error.
can we use something else at the place of onCreate().
For Click functionality there is no need, this is the code you need:
any imports needed ??
Yes, anytime your see "new insert word here" you'll need to import it.
This may help as well: