Android Change textView text from another method/class -
    after click on button1, layout , class gets called. want change text of textview out of class 2 results in app crash  java.lang.nullpointerexception   important parts of class 1   public static textview a; protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_main);   [button stuff in class 1]    setcontentview(r.layout.raten);                       final    textview = (textview) findviewbyid(r.id.a); //the textview wanna chage                  max = 10;                       easy easy = new easy(); // other class                       easy.e();   [now method in class 1 should change text]       public static void tx(int i)     {  a.settext("adsfasdf");     }   [important parts of class 2 ("easy")]   public void e(){         system.out.println("called class easy");      int max = mainactivity.max;     system.out.println(max);     (int i= 0; i<max; i++){         syste...