0
ich versuche, von RecycleView
Adapter
-Activity
Element zu teilen, aber ich habe diesen Fehler:Teilen Element Adapter Aktivität
incompatible types:
Context
cannot be converted toActivity
holder.img_pro.setTransitionName(context.getString(R.string.share));
Intent i = new Intent(context, Details_activity.class);
Pair<View, String> pair1 = Pair.create(holder.img_pro, holder.img_pro.getTransitionName());
i.putExtra(AppConstants.SCREEN, "0");
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(context, pair1);
context.startActivity(i, options.toBundle());
Wer kann mir helfen?
Dank
jeden nicht Kontext eine Aktivität ist . Auf welcher Zeile erhalten Sie diesen Fehler? –
ActivityOptionsCompat-Optionen = ActivityOptionsCompat.makeSceneTransitionAnimation (Kontext, Paar1); – Pihu
dann müssen Sie eine 'Activity' als ersten Parameter übergeben, keinen Kontext. Wenn Sie sicher sind, dass Ihr 'Context' eine' Activity' ist, dann werfen Sie einfach 'Activity' auf –