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;








0















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










share|improve this question






























    0















    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










    share|improve this question


























      0












      0








      0








      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 16:28









      Zoe

      15.2k85789




      15.2k85789










      asked Sep 21 '17 at 9:17









      Nikhil PatilNikhil Patil

      245




      245






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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);

          );





          share|improve this answer

























          • 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











          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%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









          0














          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);

          );





          share|improve this answer

























          • 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















          0














          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);

          );





          share|improve this answer

























          • 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













          0












          0








          0







          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);

          );





          share|improve this answer















          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);

          );






          share|improve this answer














          share|improve this answer



          share|improve this answer








          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

















          • 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



















          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%2f46340005%2fgetting-error-with-glide-assert-java-lang-illegalargumentexception-you-must-ca%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현