title: How to Call Method in Activity From Other Class not Activity in Android?
body: <p>I have 2 class in my project, first extend activity and other extend other class. please help how to call the method in main activity from other class not activity? here my code :</p>
  
  <ol>
  <li><p><strong>Extend Activity Class</strong></p>
  
  <pre><code>public class Isign extends Activity {
  private static final String TAG         = "Sample::Activity";
  
  public Isign() {
      Log.i(TAG, "Instantiated new " + this.getClass());
  }   
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      Log.i(TAG, "onCreate");
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      super.onCreate(savedInstanceState);
      a = new IsignView(this);
  
  LinearLayout lv = new LinearLayout(this);
  lv.setOrientation(LinearLayout.VERTICAL);
  LinearLayout.LayoutParams textViewParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
  
  tv = new TextView(this);
  tv.setTextSize(20);
  tv.setText("RESULT : ");
  tv.setLayoutParams(textViewParams);
  lv.addView(tv);
  lv.addView(a);
  
  setContentView(lv);} 
  
  public void update_kom(String d){
      Log.i("asd", "asd");
      tv.setText("");
      tv.setText("RESULT : " + d);
  }
  </code></pre></li>
  <li><p><strong>Not Extend Activity Class</strong></p>
  
  <pre><code>public class IsignView  extends IsignCvViewBase  {
  public IsignView(Context context) {
  super(context);
  
  try {
  
  } catch (IOException e) {
      e.printStackTrace();
      Log.e(TAG, "Failed to load cascade. Exception thrown: " + e);
  }
  }
  </code></pre></li>
  </ol>
  
  <p>By the way I Have used this way to call method from main activity :</p>
  
  <pre><code>new Isign().update_kom("bottle");
  </code></pre>
  
  <p>and i get this error LogCat :</p>
  
  <pre><code>07-05 06:52:22.290: E/AndroidRuntime(2708): FATAL EXCEPTION: Thread-12
  07-05 06:52:22.290: E/AndroidRuntime(2708): java.lang.NullPointerException
  07-05 06:52:22.290: E/AndroidRuntime(2708): at 
  org.baharsan.isign.Isign.update_kom(Isign.java:86)     
  07-05 06:52:22.290: E/AndroidRuntime(2708): at 
  org.baharsan.isign.view.IsignView.processFrame(IsignView.java:353)
  07-05 06:52:22.290: E/AndroidRuntime(2708): at 
  org.baharsan.isign.cv.IsignCvViewBase.run(IsignCvViewBase.java:101)
  07-05 06:52:22.290: E/AndroidRuntime(2708): at 
  org.baharsan.isign.view.IsignView.run(IsignView.java:557)
  07-05 06:52:22.290: E/AndroidRuntime(2708): at  
  java.lang.Thread.run(Thread.java:1019)
  </code></pre>
  
  <p>Thank you for your Response, i am sorry if this question repeated while i can't find similiar question like my problem. other problem just show me how to call method in other class from main activity but this question is opposite. "how to call method in main activity from other class?"</p>
  
  <p>thank you so much :)</p>