0
votes

i got 2 java files app.java and 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 

  }

}

1
Duplicate of the question you asked 30 min ago? how do i call a java file on click in another java class?aioobe
remormatted the question to understand it betterSrikanth Naidu

1 Answers

0
votes

Assuming Gallery.java also extends Activity you should call:

Intent mIntent = new Intent(this, Gallery.class);
startActivity(mIntent);