Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1.             for (int i=0; i < iconArray.length;i++)
  2.             {
  3.                
  4.                
  5.                
  6.                 if (iconArray[i].length() < 1)
  7.                 {
  8.                     generatedBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.sten48);
  9.                    
  10.                     Log.i("log_tag",
  11.                            
  12.                             "SRC ÄR TOM SRC ÄR TOM FÖRFAN" + "iconArray längd:" + iconArray.length);
  13.                 }
  14.                 else
  15.                 {
  16.                    
  17.                
  18.                 URL url = new URL(iconArray[i]);
  19.                 HttpURLConnection connection = (HttpURLConnection) url.openConnection();
  20.                 connection.setDoInput(true);
  21.                 connection.connect();
  22.                 InputStream input = connection.getInputStream();
  23.                 generatedBitmap = BitmapFactory.decodeStream(input);
  24.                 connection.disconnect();
  25.                 input.close();
  26.                
  27.                 bitmapArray [i] = generatedBitmap;
  28.                
  29.                
  30.                 Log.i("log_tag",
  31.                        
  32.                         "VAFAAAAAAAAAN KÖR MIG");
  33.                                     //Log.i("log_tag", "bitmapArray längd:" + bitmapArray.length);
  34.                 }
  35.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement