I want to open a class and a method of that class from another class simultaneously. When i click on button it stops the application. Help!
Method of class 'Fixtures' from which I want to call class and Method
public void onClick(View arg0) {
// TODO Auto-generated method stub
int id = arg0.getId();
FixtureDetails abc = new FixtureDetails();
abc.xyz(id);
startActivity(new Intent(Fixtures.this, FixtureDetails.class));
}
Class and method which I want to be opened
public class FixtureDetails extends Activity{
TextView tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.fixturedetails);
tv = (TextView) findViewById(R.id.tv);
}
void xyz(int lmn)
{
switch(lmn)
{
case R.id.tvMatch1:
tv.setText("Hey there, wassup");
break;
}
}
}