Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with & and double quotes in my Android app

in my app I am facing following two problems

  1. I am trying to show some text from strings.xml file stored in res/values folder. The problem is whenever I enter the & it shows an error as follows:

    Multiple annotations found at this line:
    - The entity name must immediately follow the '&' in the entity reference.
    - error: Error parsing XML: not well-formed (invalid token)

When I remove it the error gets cleared. how to use such special characters in my app

  1. When I click a button in my app it hits an url and in return I am getting an return data as follows

    <img src="http://xxxxxxxxxxxxxxxxxxx/test.php%3Fcode_hash%3Da8c159f35af&amp;guid=ON"/>
    

I want to get this url removing the img src="

I tried using the replacewith("","");

But here I am unable to give the " within the double quotes.

How to solve the above issues?

like image 682
Siva K Avatar asked Jul 14 '11 06:07

Siva K


People also ask

Do you have any problem with that meaning?

From Longman Dictionary of Contemporary English. Do you have a problem with that? spoken informal used to ask someone why they seem to disagree with you, in a way that shows that you are annoyed → problemExamples from the CorpusDo you have a problem with that?

What does have a problem with idiom mean?

idiom informal. to find something or someone annoying or offensive: I have a real problem with people who use their mobile phones on the train. She can smoke - I don't have a problem with that.

What does I have a problem mean?

Definition of have a problem with : to feel that something is not acceptable or agreeable to oneself Do you have a problem with something I said?

What is your problem in meaning?

​Definitions and Synonyms. phrase​spoken. DEFINITIONS1. used for asking someone in a threatening way why they are behaving in a way that you do not like or approve of.


1 Answers

In XML strings for & (ampersand) you need to use &amp; and quotes (single or double) need to be escaped,

<string name="with_amp">I, Me &amp; Myself</string>
<string name="with_quotes>Single quote \' and Double quotes \"</string>
like image 86
source.rar Avatar answered Oct 20 '22 00:10

source.rar