wasabeef / richeditor-android

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.
Apache License 2.0
6.25k stars 1.2k forks source link

setBackgroundResource(Drawable) can't accept a selector or shape xml as the parameter? #201

Open pwcat opened 5 years ago

pwcat commented 5 years ago

For example, a selector file like this: `<?xml version="1.0" encoding="utf-8"?>

` pass it into the method : **editor.setBackgroundResource(R.drawable.post_et_selector)** cause crash: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference at jp.wasabeef.richeditor.Utils.toBase64(Utils.java:36) at jp.wasabeef.richeditor.RichEditor.setBackgroundResource(RichEditor.java:226)
pwcat commented 5 years ago

well, just saw the source codes and understood why. I might need to find another way.