How to call another activity(class) from one activity? [closed]

start as:

builder1.setNegativeButton("secondact", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub
                    Intent i=new Intent(Current_Activity.this, FbsampleActivity.class);
                    //or

                    //Intent i=new Intent(getApplicationContext(), FbsampleActivity.class);
                     startactivity(i);
                }
            });

NOTE: Do not use getBaseContext() use getApplicationContext() or Current_Activity.thisenter code here for Starting new Activity

Leave a Comment