I am trying to call a method from another class but I get an exception error.
I have two classes and class 1 is the main class
Class 1 has an onclick<
EDITED (because Kevin deleted previous answer):
Android is a bit specific in this situation..
In case one of your class is Activity and the other is "helper" class, situation implies than you need to create an instance of the "helper" class in Activity class. Something like
private Helper helper = new Helper(this);
and than you can call methods of helper class, anywhere in your Activity by using:
helper.nameOfMethod(requiredParameters);
It might happen that your ClassA is Activity (so it extends Android Activity class) and ClassB is Activity too but extends ActivityA. In this situation you should be able to use methods of ActivityA from ActivityB just by calling it by method name (without explicitly writing where is your method stored).
methodFromActivityB(parameters);
Hope it's a bit easier to understand it now.