/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull public static Intent intentFor (final @Nonnull Rank rank) { return new Intent(getActionPackage() + rank.name()); }
@Override public void onItemClick (final @Nonnull AdapterView<?> a, final @Nonnull View view, final @Nonnegative int position, final @Nonnegative long id) { final Taxon taxon = (Taxon)taxonBrowserAdapter.getItem(position); try { final Intent intent = TaxonIntentHelper.intentFor(taxon); if (rank.equals(Rank.SPECIES)) // final one { controlFlow.toNextStep(intent); } else { controlFlow.toNextStep(intent, AndroidFlowController.USE_INTENT_FILTER); } } catch (NotFoundException e) { throw new RuntimeException(e); } } };
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull public static Intent intentFor (final @Nonnull Taxon taxon) throws NotFoundException { // FIXME: you should really use the Uri, but it fails to find the Intent // FIXME: probably it needs a further declaration in the Android manifest // return new Intent(ACTION_TAXON, Uri.parse(taxon.getId().stringValue())); final Intent intent = new Intent(getActionPackage() + taxon.getRank().getNarrower().name()); intent.putExtra(TAXON_ID, taxon.getId().stringValue()); return intent; }