Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:10:16+00:00 2026-06-01T08:10:16+00:00

My app has to display an image preview from the image data obtained as

  • 0

My app has to display an image preview from the image data obtained as InputStream from a web service. InputStream is decoded to Bitmap to display in ImageView. This entire flow is working fine in Android 2.2 and 2.3, whereas it’s not functioning with Android 3.0 and 4.0. The bitmap decoded is null in the latter case whereas its fine in 2.x.

Here is the code snippet I use..

ImageView imgView = (ImageView) findViewById(R.id.image);       
String imageUrl = "my webservice url";      
HttpClient httpClient = new DefaultHttpClient();
HttpGet mHttpGetEntity = new HttpGet(imageUrl);
HttpResponse response;
try {
    response = httpClient.execute(mHttpGetEntity);
    XmlPullParser xpp = XmlPullParserFactory.newInstance().newPullParser();       
    InputStream is = response.getEntity().getContent();
    xpp.setInput(is, "UTF-8");
    // use xpp for process
    imgView.setImageBitmap(BitmapFactory.decodeStream(is));        
} catch (ClientProtocolException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
}

How can I make this work even with Android 3.0 above. Please advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:10:17+00:00Added an answer on June 1, 2026 at 8:10 am

    your code is doing fine on my 4.0. I would say don’t worry about 3.0 since it is unstable version no one will use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an iPhone app that will pull data down from a Web API,
Okay, here is my issue: My app has a display of categories in the
My app has an expensive service method, results of which must be 1) checked
I want to display an image located in the app-storage directory of my AIR
I have an app which has to load some data at startup, so I
i am implementing an app that has 2 images that i need to display
I have this tableview in my app which has a particular item name such
I want to do some image processing with images from camera and display it
In my app an user has the ability to upload their logo to display
I am having trouble getting a UIImage to display instantly after the app has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.