opened
boby1975
username_0
How to edit some content after loading it by mEditor.loadData(someData)? thnks
issue
created
vikas-jain-plutus
username_1
I am also facing the same issue. After calling the mEditor.loadData() method, I am not able to edit the loaded data.
Can you guys please give me some solution?
comment
created
vikas-jain-plutus
username_1
Can anyone help me with this? It's really a very emerging issue right now.
comment
created
vikas-jain-plutus
username_1
Thanks in Advance...
comment
created
vikas-jain-plutus
username_1
@username_0 Can you please help me with this part?
comment
created
vikas-jain-plutus
username_1
@bmadaras @lijunjieone @richfuns Anyone can help me on this question?
comment
created
boby1975
username_0
Use  richEditor.setHtml(htmlString)
comment
created
vikas-jain-plutus
username_1
@username_0 yes I have used the richEditor.setHtml(htmlString) method. But still, I am not able to focus on the Editor after display the data. Is there anything I`m missing?
Please let me know.
comment
created
boby1975
username_0
Try this richEditor.setInputEnabled(true)
comment
created
vikas-jain-plutus
username_1
@username_0 I have used the following methods to enable the Editor View after loading the data.
        mEditor.setHtml(Globals.getInstance().currentClub.getDescription());
        mEditor.setInputEnabled(true);
        mEditor.setClickable(true);
        mEditor.setFocusable(true);
        mEditor.setFocusableInTouchMode(true);
        mEditor.setSaveEnabled(true);
comment
created
vikas-jain-plutus
username_1
@username_0 Thanks for your help...
It's appreciated...
comment
created
vikas-jain-plutus
username_1
@username_0 I need one more help from you...
How can we send an image with bitmap or Base64?
Right now Editor only accepts Url in String.
comment
created
boby1975
username_0
may be this helps
in my class RichEditor
..
    public RichEditor(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);

        setVerticalScrollBarEnabled(false);
        setHorizontalScrollBarEnabled(false);
        getSettings().setJavaScriptEnabled(true);
        getSettings().setUseWideViewPort(true);
        getSettings().setLoadWithOverviewMode(true);
        getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING);
        getSettings().setSupportZoom(true);

        setWebChromeClient(new WebChromeClient());
        setWebViewClient(createWebviewClient());
        loadUrl(SETUP_HTML);

        applyAttributes(context, attrs);
    }
comment
created
boby1975
username_0
You can insert image by url and base64 as well when editor has focus
examples: 
file file_oops.png is located in assets folder
String imagePath = "file:///android_asset/file_oops.png";
richEditor.insertImage(imagePath, "fileName");

or base64 image
String imageBase64 = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
richEditor.insertImage(imageBase64, "fileName");
comment
created
vikas-jain-plutus
username_1
@username_0 Do I need to append "data:image/png;base64," this string with base64 data string?
comment
created
boby1975
username_0
Yes. See my working example above
comment
created
vikas-jain-plutus
username_1
@username_0 I have prepared base 64 String with appending "data:image/png;base64,. But still, HTML not loaded on the preview. IF I am using a local path for displaying an image, It will load the image..but at the same time, we can`t see those images on the server or iOS.
comment
created
vikas-jain-plutus
username_1
@username_0 Can you please help me with my previous comment?
comment
created
vikas-jain-plutus
username_1
@username_0  I have used base64 image
String imageBase64 = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
richEditor.insertImage(imageBase64, "fileName");
An editor couldn`t load the Image HTML using the above code. Can you please help me?
comment
created
mohamed99akram
username_2
For Base64, use [this](https://stackoverflow.com/a/15717721/13742330) function(loadDataWithBaseURL). but it is slow in loading.
comment
created
shukrifathil
username_3
@username_1 were you able to solve the base64 load issue? I'm in a similar boat cause my app needs to load image as base64 as well.
comment