Creating a new Activity
Creating new activity and navigating onclick button (Explicit Activity)
1. goto res/layout > rt ck > select "new xml file" and "new_layout"
2. Add objects,make modifications to new layout xml file in graphical view
3. Manifest file : add below code inside "<application> </application>"
<activity android:name=".new_Activity">
4. Goto src/package > rt ck and select new>Class
5. give name as "new_Activity" ,ck OK and add below code in "new_Activity"
import android.app.Activity;
public class new_Activity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.new_layout);
}
}
6. Goto activity_main.xml ,create a button and in properties>view>On click-"method_name" and save
7. Goto Mainactivity>add below method inside the class :
public void method_name(View V)
{
Intent intent=new Intent(this,new_Activity.class);
startActivity(intent);
}