getting error with Glide assert: java.lang.IllegalArgumentException: You must call this method on the main thread'Must Override a Superclass Method' Errors after importing a project into EclipseMipmap drawables for iconsHow to load image through byte array using Glide?Glide assert: java.lang.IllegalArgumentException: You must call this method on the main threadGlide error: java.lang.IllegalArgumentException - You must call this method on a background threadGetting context for Glide, within a fragment, results in errorLoad dynamically created bitmaps with GlideHow to show images to RecycleView using Glide?How to convert a bitmap or byte array to an image?How to draw image set in an image view by glide on the canvas in Android?
What can plausibly explain many of my very long and low-tech bridges?
What makes Ada the language of choice for the ISS's safety-critical systems?
Where does "0 packages can be updated." come from?
Was Jesus good at singing?
Do any instruments not produce overtones?
Find the Factorial From the Given Prime Relationship
How to tell your grandparent to not come to fetch you with their car?
Find duplicated column value in CSV
Is an early checkout possible at a hotel before its reception opens?
Does an ice chest packed full of frozen food need ice?
Winning Strategy for the Magician and his Apprentice
How Can I Tell The Difference Between Unmarked Sugar and Stevia?
Does Disney no longer produce hand-drawn cartoon films?
Preventing Employees from either switching to Competitors or Opening Their Own Business
Genetic limitations to learn certain instruments
Can the poison from Kingsmen be concocted?
Compiling c files on ubuntu and using the executable on Windows
Why only the fundamental frequency component is said to give useful power?
Arriving at the same result with the opposite hypotheses
Was there a priest on the Titanic who stayed on the ship giving confession to as many as he could?
Is it possible to 'live off the sea'
The eyes have it
What's up with this leaf?
How does an ordinary object become radioactive?
getting error with Glide assert: java.lang.IllegalArgumentException: You must call this method on the main thread
'Must Override a Superclass Method' Errors after importing a project into EclipseMipmap drawables for iconsHow to load image through byte array using Glide?Glide assert: java.lang.IllegalArgumentException: You must call this method on the main threadGlide error: java.lang.IllegalArgumentException - You must call this method on a background threadGetting context for Glide, within a fragment, results in errorLoad dynamically created bitmaps with GlideHow to show images to RecycleView using Glide?How to convert a bitmap or byte array to an image?How to draw image set in an image view by glide on the canvas in Android?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
i want to get the bitmap from url and then want to convert it into byte array for storing it into sqlite, i am using the glide for getting the bitmap from url here is my code
Bitmap temp = null;
Bitmap temp2 = null;
try
temp = Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.into(-1, -1)
.get();
temp2 = Glide.with(this)
.load(profile_pic_url)
.asBitmap()
.into(-1, -1)
.get();
catch (InterruptedException e)
e.printStackTrace();
catch (ExecutionException e)
e.printStackTrace();
if anyone having better idea to get bitmap and convert it into byte array then feel free to suggest
android android-glide
add a comment |
i want to get the bitmap from url and then want to convert it into byte array for storing it into sqlite, i am using the glide for getting the bitmap from url here is my code
Bitmap temp = null;
Bitmap temp2 = null;
try
temp = Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.into(-1, -1)
.get();
temp2 = Glide.with(this)
.load(profile_pic_url)
.asBitmap()
.into(-1, -1)
.get();
catch (InterruptedException e)
e.printStackTrace();
catch (ExecutionException e)
e.printStackTrace();
if anyone having better idea to get bitmap and convert it into byte array then feel free to suggest
android android-glide
add a comment |
i want to get the bitmap from url and then want to convert it into byte array for storing it into sqlite, i am using the glide for getting the bitmap from url here is my code
Bitmap temp = null;
Bitmap temp2 = null;
try
temp = Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.into(-1, -1)
.get();
temp2 = Glide.with(this)
.load(profile_pic_url)
.asBitmap()
.into(-1, -1)
.get();
catch (InterruptedException e)
e.printStackTrace();
catch (ExecutionException e)
e.printStackTrace();
if anyone having better idea to get bitmap and convert it into byte array then feel free to suggest
android android-glide
i want to get the bitmap from url and then want to convert it into byte array for storing it into sqlite, i am using the glide for getting the bitmap from url here is my code
Bitmap temp = null;
Bitmap temp2 = null;
try
temp = Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.into(-1, -1)
.get();
temp2 = Glide.with(this)
.load(profile_pic_url)
.asBitmap()
.into(-1, -1)
.get();
catch (InterruptedException e)
e.printStackTrace();
catch (ExecutionException e)
e.printStackTrace();
if anyone having better idea to get bitmap and convert it into byte array then feel free to suggest
android android-glide
android android-glide
edited Mar 24 at 16:28
Zoe
15.2k85789
15.2k85789
asked Sep 21 '17 at 9:17
Nikhil PatilNikhil Patil
245
245
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Try this instead
Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.placeholder(R.drawable.place_holder_image)
.error(R.drawable.place_holder_image)
.into(new SimpleTarget<Bitmap>()
@Override
public void onResourceReady(final Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation)
Bitmap bimtapImage=resource;
//Convert this bimtapImage to byte array
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable)
super.onLoadFailed(e, errorDrawable);
);
how can i get bitmap of that image from this as i want to convert it into bytearray
– Nikhil Patil
Sep 21 '17 at 9:24
Bitmap resource inside onResourceReady gives you image in bitmap only
– sharath kumar
Sep 21 '17 at 9:25
so in onResourceReady methode i create one bitmap variable and assign it Bitmap resource object?
– Nikhil Patil
Sep 21 '17 at 9:28
Updated..check that
– sharath kumar
Sep 21 '17 at 9:31
Thanks, i will test it and report back to you
– Nikhil Patil
Sep 21 '17 at 9:36
|
show 2 more comments
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%2f46340005%2fgetting-error-with-glide-assert-java-lang-illegalargumentexception-you-must-ca%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
Try this instead
Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.placeholder(R.drawable.place_holder_image)
.error(R.drawable.place_holder_image)
.into(new SimpleTarget<Bitmap>()
@Override
public void onResourceReady(final Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation)
Bitmap bimtapImage=resource;
//Convert this bimtapImage to byte array
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable)
super.onLoadFailed(e, errorDrawable);
);
how can i get bitmap of that image from this as i want to convert it into bytearray
– Nikhil Patil
Sep 21 '17 at 9:24
Bitmap resource inside onResourceReady gives you image in bitmap only
– sharath kumar
Sep 21 '17 at 9:25
so in onResourceReady methode i create one bitmap variable and assign it Bitmap resource object?
– Nikhil Patil
Sep 21 '17 at 9:28
Updated..check that
– sharath kumar
Sep 21 '17 at 9:31
Thanks, i will test it and report back to you
– Nikhil Patil
Sep 21 '17 at 9:36
|
show 2 more comments
Try this instead
Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.placeholder(R.drawable.place_holder_image)
.error(R.drawable.place_holder_image)
.into(new SimpleTarget<Bitmap>()
@Override
public void onResourceReady(final Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation)
Bitmap bimtapImage=resource;
//Convert this bimtapImage to byte array
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable)
super.onLoadFailed(e, errorDrawable);
);
how can i get bitmap of that image from this as i want to convert it into bytearray
– Nikhil Patil
Sep 21 '17 at 9:24
Bitmap resource inside onResourceReady gives you image in bitmap only
– sharath kumar
Sep 21 '17 at 9:25
so in onResourceReady methode i create one bitmap variable and assign it Bitmap resource object?
– Nikhil Patil
Sep 21 '17 at 9:28
Updated..check that
– sharath kumar
Sep 21 '17 at 9:31
Thanks, i will test it and report back to you
– Nikhil Patil
Sep 21 '17 at 9:36
|
show 2 more comments
Try this instead
Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.placeholder(R.drawable.place_holder_image)
.error(R.drawable.place_holder_image)
.into(new SimpleTarget<Bitmap>()
@Override
public void onResourceReady(final Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation)
Bitmap bimtapImage=resource;
//Convert this bimtapImage to byte array
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable)
super.onLoadFailed(e, errorDrawable);
);
Try this instead
Glide.with(this)
.load(urlNavHeaderBg)
.asBitmap()
.placeholder(R.drawable.place_holder_image)
.error(R.drawable.place_holder_image)
.into(new SimpleTarget<Bitmap>()
@Override
public void onResourceReady(final Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation)
Bitmap bimtapImage=resource;
//Convert this bimtapImage to byte array
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable)
super.onLoadFailed(e, errorDrawable);
);
edited Sep 21 '17 at 9:31
answered Sep 21 '17 at 9:19
sharath kumarsharath kumar
3,0311616
3,0311616
how can i get bitmap of that image from this as i want to convert it into bytearray
– Nikhil Patil
Sep 21 '17 at 9:24
Bitmap resource inside onResourceReady gives you image in bitmap only
– sharath kumar
Sep 21 '17 at 9:25
so in onResourceReady methode i create one bitmap variable and assign it Bitmap resource object?
– Nikhil Patil
Sep 21 '17 at 9:28
Updated..check that
– sharath kumar
Sep 21 '17 at 9:31
Thanks, i will test it and report back to you
– Nikhil Patil
Sep 21 '17 at 9:36
|
show 2 more comments
how can i get bitmap of that image from this as i want to convert it into bytearray
– Nikhil Patil
Sep 21 '17 at 9:24
Bitmap resource inside onResourceReady gives you image in bitmap only
– sharath kumar
Sep 21 '17 at 9:25
so in onResourceReady methode i create one bitmap variable and assign it Bitmap resource object?
– Nikhil Patil
Sep 21 '17 at 9:28
Updated..check that
– sharath kumar
Sep 21 '17 at 9:31
Thanks, i will test it and report back to you
– Nikhil Patil
Sep 21 '17 at 9:36
how can i get bitmap of that image from this as i want to convert it into bytearray
– Nikhil Patil
Sep 21 '17 at 9:24
how can i get bitmap of that image from this as i want to convert it into bytearray
– Nikhil Patil
Sep 21 '17 at 9:24
Bitmap resource inside onResourceReady gives you image in bitmap only
– sharath kumar
Sep 21 '17 at 9:25
Bitmap resource inside onResourceReady gives you image in bitmap only
– sharath kumar
Sep 21 '17 at 9:25
so in onResourceReady methode i create one bitmap variable and assign it Bitmap resource object?
– Nikhil Patil
Sep 21 '17 at 9:28
so in onResourceReady methode i create one bitmap variable and assign it Bitmap resource object?
– Nikhil Patil
Sep 21 '17 at 9:28
Updated..check that
– sharath kumar
Sep 21 '17 at 9:31
Updated..check that
– sharath kumar
Sep 21 '17 at 9:31
Thanks, i will test it and report back to you
– Nikhil Patil
Sep 21 '17 at 9:36
Thanks, i will test it and report back to you
– Nikhil Patil
Sep 21 '17 at 9:36
|
show 2 more comments
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%2f46340005%2fgetting-error-with-glide-assert-java-lang-illegalargumentexception-you-must-ca%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