Questions tagged [settext]

The concept of assigning text to a UI element

The concept of assigning text to a UI element.

Does not specifically refer to a programming language-specific or library-specific API but the general concept.

793 questions
-1
votes
1 answer

Java JLabel setText Method Not Working

I've been trying to figure out what the problem is, but i cannot figure it out. I call a method from a class using w.setCandyAmountLabelText(numberofcandies); However it does not work. I am trying to change the text of a jlabel which is in another…
gman9732
  • 77
  • 2
  • 10
-1
votes
1 answer

How to share a variable within an activity?

How can I grab the variable parent from OnItemSelected and use it in onClick? I was to do this within onClick result = parent.getItemAtPostition(pos).toString(); selected = (TextView) findViewById(R.id.selected); selected.setText(result); I want…
Malaka
  • 1,581
  • 5
  • 16
  • 16
-1
votes
3 answers

setText make apk crash

I'm trying to develop a very simple apk. I'm using a textView to show two team's name that i enter in a previous activity (brought here with the intent that open this activity). When i try to use setText to show the names of these teams the apk…
David Corsalini
  • 7,958
  • 8
  • 41
  • 66
-2
votes
2 answers

TextView.setText throws NullPointerException despite given String not being null

When I try to set the Author and the Date for my Program the TextView.setText method throws a NullPointerException: Content of the Custom Object Error 1: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.jokestarapplication, PID:…
-2
votes
3 answers

setText is shown in red and i don't undrestand why

setText is shown in red and i don't undrestand why public class MainActivity extends AppCompatActivity { TextView v = (TextView)findViewById(R.id.textInput); Button b = (Button)findViewById(R.id.btn12); @Override protected void…
xXxlazharxXx
  • 433
  • 4
  • 8
-2
votes
1 answer

json yield works correctly in log records, but when I print with settext in textview, only one yield appears

In the log results, all json data is written completely but when I do it with settext technique, only 1 yield is written. I want to print all of my json output to my edittex. Can you help ?…
-2
votes
1 answer

SetText of TextView using String Array in a Fragment class

I am trying to make cards in a cardView like Duolingo, I found code online and I am trying to edit that code according to my needs. The issue is I do not know how to use the array list of String and change its text in each card as it changes. I…
sulli110
  • 145
  • 2
  • 16
-2
votes
2 answers

Convert Toast.makeText to textView setText

I create apps to get user locations in coordinate like latitude and longitude, so I use play-service-location, my program code is below: import android.location.Location; import android.os.Bundle; import…
-2
votes
1 answer

Why does android studio only let me set text (on a button or text view) by chars (and not strings?)

Whether I try to change a textView or a button, why does Android Studio require that I pass only chars and not strings in the setText() method?
-2
votes
1 answer

Cannot use setText() method in Java Netbeans

I inserted a text field and now I just want it to say "working" within the text field. I do not have any errors, but when the display comes up the text field is empty. The first line of the code below was generated by netbeans. I wrote the second…
-2
votes
1 answer

textView setText() and append() crashing when OnClick function is called

I'm making a Sudoku app and I want to add a Move Counter so I have a textView that is displayed with the movecount every time the user inputs a number public class NumberButton extends Button implements OnClickListener { private int number; …
-2
votes
1 answer

How to move a setText() to a new activity on Android Studio?

I am tying to make a basket and want depending on what button is pressed the price that is shown on the screen then appear in the basket (new activity) in TextView09 ( section of the table) but at the moment what is appearing is…
09Emi
  • 25
  • 2
  • 8
-2
votes
1 answer

Android Change text in TextView

I'm trying to change the text in my TextView by using the setText(). When I try to do this I get the following error: E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{}:…
btag
  • 27
  • 2
  • 9
-2
votes
2 answers

setText is not working inside a while loop

why is that? while (flag) { outCPU.setText(getCpuInfo()); } getCpuInfo returns string, if I try to write this method's return out into a log, there is everything that should be, but nothing happens to textview..
andrew
  • 183
  • 1
  • 2
  • 12
-2
votes
2 answers

setText cause "Resources$NotFoundException"

I don't know why "tex.SetText(score1);" throw Resources$NotFoundException exception my code java is below : package com.example.mehran.golyapooch; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import…