I have a method in MainActivity2 :
public void addfoto(View view) {
// meu código bla bla bla bla
}
And I want to call this method in MainActivity . I'm trying this way but gets the code wrong:
MainActivity2 m2 = new MainActivity2();
m2.addfoto();
But it's not working. How I do ?