-1

I'm trying to make an Activity that contains a huge TextView (a summary of a story or something), but when I define the String, my R.java disappears (because of the length).

I've tried to Project-> Clean, but it didn't help me.

What should I do to display that text ?

Chilledrat
  • 2,593
  • 3
  • 28
  • 38
  • 2
    It should not be because of length. There should be some other issue. – ayon Nov 30 '13 at 10:31
  • if there is any resource whose name is equal to java reserved keyword like **int**, **double**, then R.java file will not be generated. for example you have added a image in your drawable folder with the name continue.png (here **continue** is java keyword), then R.java file will not be generated... – Gopal Gopi Nov 30 '13 at 10:39
  • Also, have a look through http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error which lists a similar issue. – Chilledrat Nov 30 '13 at 10:51

1 Answers1

0

R.java will not be generated if there is a syntax error in your strings.xml. The length is not the problem. There are probably characters that need to be escaped in the text. The link is to an SO question about valid XML characters, and the accepted answer tells you what to look for and how to fix it.

Community
  • 1
  • 1
Dave
  • 4,282
  • 2
  • 19
  • 24
  • I have no syntax error in my strings.xml. checked here .[link](http://www.w3schools.com/dom/dom_validate.asp). no errors found. I cant find the problem. – user3051800 Dec 01 '13 at 13:19
  • Just a suggestion, but you can try the text piecemeal. Use only the first half of the text. If that works, use only the second half. Continue doing a binary search until you locate the problem. – Dave Dec 03 '13 at 02:24