title: Android Call a method from another class
body: <p>I know that this Question is repeated but I can't find the answer in the Internet.</p>
  <p>I want to call a method from another class.</p>
  <p>I have Class1 and Class2.</p>
  <p>In Class 2 I have this method:</p>
  <pre><code>public void UpdateEmployee(){
      //some code
  }
  </code></pre>
  <p>I want to call the above method from Class1.</p>
  <p>Thanks for any answer.</p>
  <p>----EDIT----</p>
  <pre><code>final Button btnUpdate = (Button)findViewById(R.id.btnUpd);
     btnUpdate.setOnClickListener(new View.OnClickListener() {      
       public void onClick(View v) {
               Employee updEmple = new Employee();
               updEmple.UpdateEmployee();      
              
      }
      });
  </code></pre>
  <p>----LogCat---</p>
  <pre><code>05-28 16:30:44.030: E/AndroidRuntime(25198): FATAL EXCEPTION: main
  05-28 16:30:44.030: E/AndroidRuntime(25198): java.lang.NullPointerException: println    needs a message
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at android.util.Log.println_native(Native Method)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at android.util.Log.v(Log.java:116)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at   and.net.Employee.UpdateEmployee(Employee.java:77)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at and.net.AndActivity$2.onClick(AndActivity.java:51)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at android.view.View.performClick(View.java:2485)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at android.view.View$PerformClick.run(View.java:9080)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at android.os.Handler.handleCallback(Handler.java:587)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at android.os.Handler.dispatchMessage(Handler.java:92)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at android.os.Looper.loop(Looper.java:123)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at android.app.ActivityThread.main(ActivityThread.java:3683)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at java.lang.reflect.Method.invokeNative(Native Method)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at java.lang.reflect.Method.invoke(Method.java:507)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  05-28 16:30:44.030: E/AndroidRuntime(25198):    at  dalvik.system.NativeStart.main(Native Method)
  </code></pre>