SkImageDecoder: Factory returned null
fixed, error in PHP scripts and database.
Android SkImageDecoder::Factory returned null Error
Solved. Change the code to this.
@Override
protected Bitmap doInBackground(String... params) {
// TODO Auto-generated method stub
String urlStr = params[0];
Bitmap img = null;
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(urlStr);
HttpResponse response;
try {
response = (HttpResponse)client.execute(request);
HttpEntity entity = response.getEntity();
BufferedHttpEntity bufferedEntity = new BufferedHttpEntity(entity);
InputStream inputStream = bufferedEntity.getContent();
img = BitmapFactory.decodeStream(inputStream);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return img;
}
D/skia: --- SkImageDecoder::Factory returned null
I finally solved it by using this method
public Bitmap StringToBitMap(String encodedString){
try {
byte [] encodeByte=Base64.decode(encodedString, Base64.DEFAULT);
Bitmap bitmap= BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.length);
return bitmap;
} catch(Exception e) {
e.getMessage();
return null;
}
}
Related Topics
Android Wear App Not Installing Through Handset
Writing Text File to Sd Card Fails
Gradle 0.9.+/0.9.2 Error: Unable to Load Class 'Com.Android.Builder.Testing.Api.Deviceprovider'
How to Get Meid and Imei Information Using Adb Commands on Android 5.0
Android Java.Util.Concurrent.Timeunit Convert Milliseconds to Minutes
Differencebetween Sendstickybroadcast and Sendbroadcast in Android
How to Programmatically Set Maxlength in Android Textview
There Is No Debug.Keystore in .Android Folder
Download and Extract Zip File in Android
Get a List of Available Content Providers
Broadcast Receiver Not Working in Android Oreo
How to Add Code Obfuscation for My Android Application
How to Handle One-Shot Operations in Jetpack Compose
Where Is the All Android Broadcast Intent List
How to Put a Constraintlayout Inside a Scrollview
Add 'Tools:Replace="Android:Value"' to <Meta-Data> Element at Androidmanifest