-2

Quick question:

I know a small amount of Java, and I'm working on my first very basic Android application.

I just want it to say "Your device is: Build.MODEL" but I can't figure out how to get that string to display in the XML TextView.

3 Answers3

0

Use Android Studio to generate a "blank activity", you will find it has a single String "Hello World" in it. Take it from there - and get back to SOF with further questions.

Jan Groth
  • 13,207
  • 5
  • 37
  • 52
0

You can try to see this question: Are parameters in strings.xml possible?

Try to using String paremeters on XML to do that

Community
  • 1
  • 1
Mou
  • 1,758
  • 1
  • 15
  • 28
0

in Java

TextView myText = (TextView) findViewByid(R.id.myTextViewName);
myText.setText("your device is:".concat(Build.MODEL));

(in your xml the TextView must be named myTextViewName

That's all

BredeBS
  • 196
  • 8