Sunday, 29 January 2017

how to goto one activity to another activity or how to goto onclick on button to new activity or how to open new screen as an activity onclick event

First of all you initialize your Button or TextView of ImageView or ImageButton with its particular id. this id is not duplicate be care this and then define the onclick event for Button or etc like that a_Button.setOnClickListener(new OnClickListener(){

@Override
public void OnClick(View view) {

 Intent new_screen=new Intent(AthisActivity.this,BActivity.class);

startActivity(new_screen);

 }
});

How to add new activity or screen in android

Right click on the your package name and select new activity and enter your activity name and finish.

and then edit your xml file according to your need and also check it in your project manifast file is declare of not declare your activity if not declare then declare here as like <activity android:name=""/>.