0

Solved

my problem was that my imagelink string was null sometimes, and i was bcz of bad getting data!

I have an image link which i want to download it into bitmap, this but i cant because the bitmapdownloader UniversalImageLoader both shows null, but the link is perfectly correct and working.

Im getting them from a wordpress website which the link is: http://wikirap.ir/?get_all

i face this problem sometimes for some post photos in website. so i faced it again for a post photo(i mean the imgloaders was showing null) and i decided to put another photo(which it was loading correctly in app) for the post! but guess what? it didnt load too! but when i was opening the other post with same photo(in app) its loading!

this problem is making me crazy badly!

Update:

i changed my bitmap download code but my first code was saying this error "... Bitmap.getconfig() on null object reference"

Help me to get rid of this please.

The thing i found out is that the photo shows as preview photo in list but when i click to see details it shows blank!(really bullshit)

Update Code :

Json getting : well i get it with okhttp and its ok and no need guys.

Showing in list: I use json and lazy list adapter which is working perfect and showing all photos even those i cant load them in detail page.

(preview image link is the same as detail image link)

detail page code getting bitmap:

    protected void onPostExecute(String file_url) {



        try {
            actionBar.setTitle(name1.toString() + " - " + name2.toString());
            tvinfo.setText(likes + " Likes | " + views + " Views");
        }catch (NullPointerException e)
        {

        }

        try
        {
            /**
            URL url = new URL(Imagelink);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setDoInput(true);
            connection.connect();
            InputStream input = connection.getInputStream();
            bitmaporigin = BitmapFactory.decodeStream(input);
            **/

            imgLoadercover imglcover = new imgLoadercover(ac.getApplicationContext());
            imglcover.DisplayImage(Imagelink, R.color.placeholder, cover);



        }catch (Exception e)
        {

        }


    }

0 Answers0