mikescamell / shared-element-transitions

Source code for a blog post series on Shared Element Transitions in Android
http://bit.ly/sharedelementtransitions
MIT License
284 stars 73 forks source link

Fragment to Activity Transiction #12

Closed pavelsust closed 6 years ago

pavelsust commented 6 years ago

I want to transit fragment to activity. I am using this

Intent intent = new Intent(getActivity(), SingleImage.class);
    intent.putExtra("item", songItem.getUrlC());
    intent.putExtra("view", ViewCompat.getTransitionName(imageView));

    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
            getActivity(),
            imageView,
            ViewCompat.getTransitionName(imageView));

    startActivity(intent, options.toBundle());

I can see a error in log cat

   java.lang.IllegalArgumentException: Shared element name must not be null

How i can solve it?? or can you give me any way??

preeti-sharmaAvanti commented 6 years ago

Hi, Please checked out that some value of android:transitionName must be set for ImageView in xml file. and if possible try to debug as the shared element is actually our ViewCompat.getTransitionName(imageView) this part so checked it out.