android - button settext to next class -


i have 2 classes; first.class , second.class. on first.class there button , on second.class there no button. need when button first.class clicked there text appear on second.class option save it.

first.class

button.setonclicklistener(new view.onclicklistener() {     @override       public void onclick(view v) {   } });   

public class first{ button.setonclicklistener(new view.onclicklistener() {     @override       public void onclick(view v) {      second.settext(text); } }); } 

public class second{ private static string textfromfirst;  public static void settext(string text){ second.textfromfirst = text; } } 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -