how do i call a java methods from one java class to another java class in android development?
<p>i hav two classes...both classes are extends activity..
i need  call other class method on main class on android development..its urgent..please..
i done something like subclass sub = new subclass()...its not work..</p>

<p>In 1st activity class</p>

<p>package org.me.intent_testing;</p>

<p>import android.app.Activity;
import android.os.Bundle;
import android.widget.<em>;
import android.view.</em>;
import android.content.Intent;</p>

<p>/**
 *
 * @author pavankumar
 */</p>

<p>public class FirstActivity extends Activity {</p>

<p>@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);</p>

<p>// Button orderButton = (Button)findViewById(R.id.order);
Button orderButton = new Button(this);
    orderButton.setOnClickListener(new View.OnClickListener() {</p>

<pre><code>  @Override
  public void onClick(View view) {
    Intent intent = new Intent(FirstActivity.this, secondActivity.class);
    startActivity(intent);
  }

});
</code></pre>

<p>}
}</p>

<p>In secondActivity class</p>

<p>package org.me.intent_testing;</p>

<p>/**
 *
 * @author pavankumar
 */</p>

<p>import android.app.Activity;
import android.os.Bundle;
import android.widget.<em>;
import android.view.</em>;
import android.content.Intent;</p>

<p>public class secondActivity extends Activity {</p>

<p>@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
              setContentView(R.layout.main);
   // setContentView(R.layout.order);</p>

<p>// Button orderButton = (Button) findViewById(R.id.end);
Button orderButton =  new Button(this);
    orderButton.setOnClickListener(new View.OnClickListener() {</p>

<pre><code>  @Override
  public void onClick(View view) {
    finish();
  }

});
</code></pre>

<p>}
}</p>

<p>In AndroidManifest.xml</p>

<p>

    
         
            
                
                
            
        
         
    </p>

<p></p>

<p>In R.java</p>

<p>package org.me.intent_testing;</p>

<p>public final class R {
    public static final class attr {
    }
    public static final class layout {
        public static final int main=0x7f020000;
    }
    public static final class string {
        public static final int app_name=0x7f030000;
    }
}</p>

<p>I hv problem to linking between two classes..</p>
