Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected Void doInBackground(String... params) {
- Bitmap output = null;
- try {
- URL url = new URL(params[0]);
- Log.d(TAG, "_log: output URL is: "+url.toString());
- HttpURLConnection connection = (HttpURLConnection)url.openConnection();
- connection.setDoInput(true);
- connection.connect();
- InputStream inputStream = connection.getInputStream();
- output = BitmapFactory.decodeStream(inputStream);
- Log.d(TAG, "_log: output size "+output.getByteCount());
- } catch (MalformedURLException e) {
- e.printStackTrace();
- Log.d(TAG, "_log: output with MalformedURLException "+e.toString());
- } catch (IOException e) {
- Log.d(TAG, "_log: output with IOException "+e.toString());
- e.printStackTrace();
- } catch (Exception e) {
- Log.d(TAG, "_log: output with Exception "+e.toString());
- e.printStackTrace();
- } finally {
- if (output != null) util.setupWallpaper(context, output);
- else Log.d(TAG, "_log: output is null");
- }
- return null;
- }
- output with Exception java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getByteCount()' on a null object reference
- RetrieveFeed.doInBackground(RetrieveFeed.java:57)
- RetrieveFeed.doInBackground(RetrieveFeed.java:27)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement