我有 2 个安卓应用程序。两者都安装在手机上。假设两者的包名称是 com.android.test1 和 com.android.test2。如何Main2method()
从 test1.Main 类中调用该方法?
test1 的类:
package com.android.test1;
import android.app.Activity;
import android.os.Bundle;
public class Main extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
测试2类:
package com.android.test2;
import android.app.Activity;
import android.os.Bundle;
public class Main2 extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public static void Main2method() {
//do something..
}
}