android.support.v7.widget.AppCompatImageView cannot be cast to com.rey.material.widget.ImageView
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
add a comment |
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
add a comment |
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
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
java xml
asked Jan 1 at 18:08
FeatherAndInkFeatherAndInk
88
88
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
edited Jan 1 at 19:13
Kод it
2,67342240
2,67342240
answered Jan 1 at 19:00
FeatherAndInkFeatherAndInk
88
88
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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