android.support.v7.widget.AppCompatImageView cannot be cast to com.rey.material.widget.ImageView












0















I want to load an URL into an imageView located in a different layout than the current activity layout.



I don't know what's this com.rey.material package and where it comes from. I assume maybe it is used by the template i've been importing.
Do you have an idea on how to fix this problem ?



  theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, final View view, final int pos, long l) {
// Unfold cell first then Change Stuff inside
// toggle clicked cell state
((FoldingCell) view).toggle(false);
// register in adapter that state for selected cell is toggled
adapter.registerToggle(pos);

final LayoutInflater factory = getLayoutInflater();
final View cell = factory.inflate(R.layout.cell, null);
ImageView image = (ImageView) cell.findViewById(R.id.head_image);
Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(image);



}
});


This is the layout that wraps everything together :



<com.ramotion.foldingcell.FoldingCell xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:folding-cell="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
folding-cell:additionalFlipsCount="2"
folding-cell:animationDuration="1300"
folding-cell:backSideColor="@color/bgBackSideColor"
folding-cell:cameraHeight="30">

<!-- CONTENT (UNFOLDED) LAYOUT (MUST BE AT LEAST 2x times BIGGER than content layout bellow)-->
<include layout="@layout/cell_content_layout" />

<!-- TITLE (FOLDED) LAYOUT (MUST BE AT LEAST 2x times SMALLER than content layout above) -->
<include layout="@layout/cell_title_layout" />

</com.ramotion.foldingcell.FoldingCell>


And this is the layout containing the specific imageView :



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/head_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="@drawable/head_image" />

</RelativeLayout>
</LinearLayout>









share|improve this question



























    0















    I want to load an URL into an imageView located in a different layout than the current activity layout.



    I don't know what's this com.rey.material package and where it comes from. I assume maybe it is used by the template i've been importing.
    Do you have an idea on how to fix this problem ?



      theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> adapterView, final View view, final int pos, long l) {
    // Unfold cell first then Change Stuff inside
    // toggle clicked cell state
    ((FoldingCell) view).toggle(false);
    // register in adapter that state for selected cell is toggled
    adapter.registerToggle(pos);

    final LayoutInflater factory = getLayoutInflater();
    final View cell = factory.inflate(R.layout.cell, null);
    ImageView image = (ImageView) cell.findViewById(R.id.head_image);
    Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(image);



    }
    });


    This is the layout that wraps everything together :



    <com.ramotion.foldingcell.FoldingCell xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:folding-cell="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    folding-cell:additionalFlipsCount="2"
    folding-cell:animationDuration="1300"
    folding-cell:backSideColor="@color/bgBackSideColor"
    folding-cell:cameraHeight="30">

    <!-- CONTENT (UNFOLDED) LAYOUT (MUST BE AT LEAST 2x times BIGGER than content layout bellow)-->
    <include layout="@layout/cell_content_layout" />

    <!-- TITLE (FOLDED) LAYOUT (MUST BE AT LEAST 2x times SMALLER than content layout above) -->
    <include layout="@layout/cell_title_layout" />

    </com.ramotion.foldingcell.FoldingCell>


    And this is the layout containing the specific imageView :



    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:visibility="gone">
    <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ImageView
    android:id="@+id/head_image"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:scaleType="centerCrop"
    android:src="@drawable/head_image" />

    </RelativeLayout>
    </LinearLayout>









    share|improve this question

























      0












      0








      0








      I want to load an URL into an imageView located in a different layout than the current activity layout.



      I don't know what's this com.rey.material package and where it comes from. I assume maybe it is used by the template i've been importing.
      Do you have an idea on how to fix this problem ?



        theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView<?> adapterView, final View view, final int pos, long l) {
      // Unfold cell first then Change Stuff inside
      // toggle clicked cell state
      ((FoldingCell) view).toggle(false);
      // register in adapter that state for selected cell is toggled
      adapter.registerToggle(pos);

      final LayoutInflater factory = getLayoutInflater();
      final View cell = factory.inflate(R.layout.cell, null);
      ImageView image = (ImageView) cell.findViewById(R.id.head_image);
      Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(image);



      }
      });


      This is the layout that wraps everything together :



      <com.ramotion.foldingcell.FoldingCell xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:folding-cell="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      folding-cell:additionalFlipsCount="2"
      folding-cell:animationDuration="1300"
      folding-cell:backSideColor="@color/bgBackSideColor"
      folding-cell:cameraHeight="30">

      <!-- CONTENT (UNFOLDED) LAYOUT (MUST BE AT LEAST 2x times BIGGER than content layout bellow)-->
      <include layout="@layout/cell_content_layout" />

      <!-- TITLE (FOLDED) LAYOUT (MUST BE AT LEAST 2x times SMALLER than content layout above) -->
      <include layout="@layout/cell_title_layout" />

      </com.ramotion.foldingcell.FoldingCell>


      And this is the layout containing the specific imageView :



      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:visibility="gone">
      <RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content">

      <ImageView
      android:id="@+id/head_image"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:scaleType="centerCrop"
      android:src="@drawable/head_image" />

      </RelativeLayout>
      </LinearLayout>









      share|improve this question














      I want to load an URL into an imageView located in a different layout than the current activity layout.



      I don't know what's this com.rey.material package and where it comes from. I assume maybe it is used by the template i've been importing.
      Do you have an idea on how to fix this problem ?



        theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView<?> adapterView, final View view, final int pos, long l) {
      // Unfold cell first then Change Stuff inside
      // toggle clicked cell state
      ((FoldingCell) view).toggle(false);
      // register in adapter that state for selected cell is toggled
      adapter.registerToggle(pos);

      final LayoutInflater factory = getLayoutInflater();
      final View cell = factory.inflate(R.layout.cell, null);
      ImageView image = (ImageView) cell.findViewById(R.id.head_image);
      Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(image);



      }
      });


      This is the layout that wraps everything together :



      <com.ramotion.foldingcell.FoldingCell xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:folding-cell="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      folding-cell:additionalFlipsCount="2"
      folding-cell:animationDuration="1300"
      folding-cell:backSideColor="@color/bgBackSideColor"
      folding-cell:cameraHeight="30">

      <!-- CONTENT (UNFOLDED) LAYOUT (MUST BE AT LEAST 2x times BIGGER than content layout bellow)-->
      <include layout="@layout/cell_content_layout" />

      <!-- TITLE (FOLDED) LAYOUT (MUST BE AT LEAST 2x times SMALLER than content layout above) -->
      <include layout="@layout/cell_title_layout" />

      </com.ramotion.foldingcell.FoldingCell>


      And this is the layout containing the specific imageView :



      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:visibility="gone">
      <RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content">

      <ImageView
      android:id="@+id/head_image"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:scaleType="centerCrop"
      android:src="@drawable/head_image" />

      </RelativeLayout>
      </LinearLayout>






      java xml






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 1 at 18:08









      FeatherAndInkFeatherAndInk

      88




      88
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Never mind, it was a misclick on my part:



          When importing packages for ImageView, I clicked the first package instead of the usual one, which caused this problem. Solution:



          Replace



          import com.rey.material.widget.ImageView


          with



          import android.widget.ImageView





          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997754%2fandroid-support-v7-widget-appcompatimageview-cannot-be-cast-to-com-rey-material%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Never mind, it was a misclick on my part:



            When importing packages for ImageView, I clicked the first package instead of the usual one, which caused this problem. Solution:



            Replace



            import com.rey.material.widget.ImageView


            with



            import android.widget.ImageView





            share|improve this answer






























              0














              Never mind, it was a misclick on my part:



              When importing packages for ImageView, I clicked the first package instead of the usual one, which caused this problem. Solution:



              Replace



              import com.rey.material.widget.ImageView


              with



              import android.widget.ImageView





              share|improve this answer




























                0












                0








                0







                Never mind, it was a misclick on my part:



                When importing packages for ImageView, I clicked the first package instead of the usual one, which caused this problem. Solution:



                Replace



                import com.rey.material.widget.ImageView


                with



                import android.widget.ImageView





                share|improve this answer















                Never mind, it was a misclick on my part:



                When importing packages for ImageView, I clicked the first package instead of the usual one, which caused this problem. Solution:



                Replace



                import com.rey.material.widget.ImageView


                with



                import android.widget.ImageView






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 1 at 19:13









                Kод it

                2,67342240




                2,67342240










                answered Jan 1 at 19:00









                FeatherAndInkFeatherAndInk

                88




                88
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997754%2fandroid-support-v7-widget-appcompatimageview-cannot-be-cast-to-com-rey-material%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                    Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                    A Topological Invariant for $pi_3(U(n))$