0

Hy! I am working on Android app for Cars where I want to show news of car. So I have 50 lines of text, I want to put all that text in one activity so u can scroll and read that text. Should I use TextView or something else? Should I save that whole text in res/strings.xml ?

sanaya
  • 3
  • 5

3 Answers3

1

You can use the TextView itself. To make it scrollable see this Stackoverflow answer. It is recommended to store strings in strings.xml

Community
  • 1
  • 1
Aswin P J
  • 493
  • 3
  • 13
0

If you need scrolling content, the easiest thing to do is place the view to be scrolled in a ScrollView. This works for any type of view that does not scroll itself, including TextView.

Doug Stevenson
  • 236,239
  • 27
  • 275
  • 302
  • actually i want to scroll image as well as text as i mentioned in my activity there is one image and below that detail of image and using scrollview it only scroll text how can i scroll both ? – sanaya Apr 16 '16 at 12:03
  • Put all the content to scroll in a container such as LinearLayout, then put the LinearLayout inside a ScrollView. ScrollView will scroll the whole thing for you. – Doug Stevenson Apr 16 '16 at 15:43
0

You can use TextView. However, i recommend use the following part in the .xml part:

<TextView
    android:text="@string/nameofthetext"
/>

nameofthetext should be save in the strings.xml file (You'll find in the values folder)

NyanMe
  • 43
  • 8