Первый активити (лисенер и т.д) на нём кнопочка нажав на которую попадаю во второй активити
Во втором активити тоже кнопочка.... но уже для перехода на третий активитиpublic void onClick(View v) {
Intent intent;
switch (v.getId()) {
case R.id.costs:
intent = new Intent(this, Hello.class);
startActivity(intent);
finish();
break;
}
}
После запуска первая и вторая активити работают но как перехожу по кнопочке на второй активити к третьей то вот на этой строке эррорит.@Override
public void onClick(View v) {
Intent intent2;
switch (v.getId()) {
case R.id.Category:
intent2 = new Intent(this, CategoryActivity.class);
startActivity(intent2);
finish();
break;
default:
break;
}
}
Подскажите что сделать что бы на третий и последующие активити выйти?catch (NoSuchMethodException e) {
int id = getId();
String idText = id == NO_ID ? "" : " with id '"
+ getContext().getResources().getResourceEntryName(
id) + "'";
throw new IllegalStateException("Could not find a method " +
handlerName + "(View) in the activity "
+ getContext().getClass() + " for onClick handler"
+ " on view " + View.this.getClass() + idText, e);
}
}