开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜