New Activity On Button Click via Intent
App->res->Layout->Blank Activity A new xml file is created and a new class is added to java folder. In manifest.xml file, A new activity is added. Copy intent filter and paste it in the second class. Change the category name first- change launcher to DEFAULT. Copy path from second.xml(from text tab : “tools:context”) file to manifest file action tab. Add a button to first Activity. By clicking on it, open second activity.
Code Private static Button btn; Btn=(Button)findViewById(R.id.button); Btn.setOnClickListener(new View.OnClickListener(){ Public void onClick(View V) {//Create an object of Intent Intent intent=new Intent(“path”);//from manifest startActivity(intent); } }); } Call the method in onCreate() method.