How can i access a method inside the another method in another class? : 
 Whenever I create an Android app. I  use a switch statement to access multiple  buttons. When I click a button how can  I understand which button was pressed., from another class?

The other class is not  an activity class. can anyone show me the right code.? for better understand.

My first class is...

     public void onClick(View v){
        switch (v.getId()){
                    case R.id.button1 :
                        GifView.mymethod(R.id.button1);
                    final Dialog dialog1=new Dialog(context);
                    dialog1.setContentView(R.layout.dialog);

                    Button finish1= (Button) dialog1.findViewById(R.id.finish);
                    finish1.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            dialog1.dismiss();
                        }
                    });
                    dialog1.show();
                        break;
I want pass this button id onto another class.. 

    private void init(Context context) {
        switch(?????){
            case R.id.button1:
                setFocusable(true);
                gifInputStream = getResources().openRawResource(R.drawable.hen);

                gifMovie = Movie.decodeStream(gifInputStream);
                movieWidth = gifMovie.width();
                movieHeight = gifMovie.height();
                movieDuration = gifMovie.duration();
                break;

what can i do inside the switch statement?

    public static int mymethod(int id) {
        int buttonId=id;
        return buttonId;
    }

