Intent intentTrashcanLocation = new Intent(this, …. Your activity_trashcan_location layout does not contain the views widthView and lengthView . Instead …