Reputation: 1
I want to know if threre is a way to use a button.OnclickListener() to go from one activity to xml file without making a class for that xml.For example:
btn.OnClickListener(new OnclickListener(){
@Override public void onClick(View v) {
Intent i = new Intent(ex.this, ex.class);
startActivity(i);
}};
we use the intent to go from activity class to another new activity class, and in the new class there is setContentView(R.layout.example); in onCreate method, so the xml layout will be displayed.
but I ask if there is a way to display the xml layout withot making a class activity.
Upvotes: 0
Views: 332
Reputation: 231
There isn't if want to go to a new activity I believe you need a class. You can do this programatically without any XML. (however I am reasonably new to android so could be wrong)
Upvotes: 0