I receive Data from Server text and in the text there is something like this '[LoadImage:ImageLink]' and I want this text to be replaced with the ImageLink I know how to download the image from the link but I don't know how to display it in the textview
I have heard somethings about regular expression but I don't know how does it work
( i don't wanna use ImageSpan , i want to replace that text ([LoadImage:ImageLink]) to image )
i found this in a forum but it wasn't complete
(I want something like this)
String text = "This is An Image File [LoadImage:'image1.png'] this is Another Image [LoadImage:'image2.png']";
Pattern pattern = Pattern.compile("\\[LoadImage:(.*?)\\]")
ProccessText( Text, layoutRoot, R.layout.image_style, R.layout.text_style);
private void processText(String text, LinearLayout layoutRoot,int imageLayout, int textLayout) {
// proccess input Text Here !
// i don't know what should i write here
}