How can i access or execute .java file in another javafile in android app development?
i got 2 java files app.java a开发者_运维技巧nd gallaery.java
App.java public class App extends Activity implements OnClickListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button Listvideo = (Button) findViewById(R.id.Listvideo);
Listvideo.setOnClickListener(this);
public void onClick(View view) {
if (view == findViewById(R.id.Listvideo)) {
// i have to call gallery.java here which executes list of images in the android pone
}
}
Assuming Gallery.java also extends Activity you should call:
Intent mIntent = new Intent(this, Gallery.class);
startActivity(mIntent);
精彩评论