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
5 answers

android studio java NullPointerException on setText method

I have a problem, been searching since yesterday, I post the code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_show_wishes); mListView =…
Agent_M
  • 1
  • 1
-1
votes
1 answer

Percentage Format in settext not correctly displayed

I have programmed a small test and at the end the result is supposed to show a percentage. Currently there are three questions and the percentage is almost correct, e.g. 2/3 will show 66.0% instead of 66.7 or 67. Percentage is formatted as double…
kingklang
  • 3
  • 3
-1
votes
2 answers

Set random text with multidimensional array

I'm trying to setText to a textView with multidimensional array with random number. It works fine but only once. How can i make it so that with each button click the text changes itself again and again. Here is my code (I cut it a bit to keep it…
Ali
  • 27
  • 6
-1
votes
1 answer

setText from another class will open another windows

(Sorry for bad English) I am trying to edit the JLabel from another class and it success but i found a problem that once it edit the text, it will open another window. How can fix it? Code: Menu.java: package Demo1; import java.awt.*; import…
yo777
  • 3
  • 1
-1
votes
1 answer

JLabel and setText Misunderstanding

I'm new to coding and right now am just doing it as a hobby. I've created an analog clock and I have a jlabel set up to tell me how many minutes have passed. However, I can't seem to figure out what I'm doing wrong with setText("....") to update…
-1
votes
1 answer

setText for Label - Objective C Xcode 7

I am very new to iOS development I have come across an issue where the label does not want to display the value in an NSArray. Please could someone help point out where it is wrong and why? NSDictionary *json = [NSJSONSerialization…
Alexander
  • 1,424
  • 18
  • 23
-1
votes
1 answer

setText within Fragment not updating

I am currently attempting to clear the sensor values in a fragment, that are constantly being updated, however the clear button that I have set does nothing, even when I have paused the sensors. Have I correctly setup the onViewCreated? I have also…
-1
votes
1 answer

How to implement spannable more than once in the following code?

##As spannable can't access data from outside of onclick listener, the whole code is written inside on click listener## rd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { int…
-1
votes
2 answers

runOnUiThread settext only works at the first time during a loop

I have an ArrayList of Textviews populated by an expandListAdpater, my goal is to change the values of the textViews, but for some reason it works only once. I tried different timers, tried to tie my handler to the ui thread, it never works. here is…
-1
votes
1 answer

How to setText in EditText from bufferreader Android

i have a BufferedReader buf = new BufferedReader(new FileReader(file)); the result of buf i want to set in the EditText. I do it that way: DecimalFormat REAL_FORMATTER = new…
noobee
  • 373
  • 1
  • 4
  • 10
-1
votes
3 answers

setText causing problems

I have gone through many articles and found similar, but have not found any that have allowed me to fix the issue. I am trying to create a random number generator and I cannot get the random number to get into the text field. This seems so simple…
Andrew
  • 3
  • 1
-1
votes
4 answers

null pointer exception in first setText

This a code of timer that save information in pause and reset. every time I start app this information are put to timer. because I don't want start timer from 0. I want start timer from last time. so in the beginning It should retrieve the last time…
sara sara
  • 47
  • 9
-1
votes
1 answer

NullPointerException when trying to print random values in android studio

I keep getting a null pointer exception at lines 99 and 77, which is where I attempt to print the random values created by the random class (line 99), and where I call my setQuestion method (line 77. randomNum to the layout_game xml file. I'm not…
user3504501
  • 3
  • 1
  • 3
-1
votes
1 answer

TextView setText doesn't work under WAKE_LOCK-ED Activity

I have an alarm that sets off after a certain time using an activity. This Activity shows up under WAKE_LOCK function. Now, I want the activity to display information of the alarm. I use TextViews to display the information inside the onCreate of…
stanley santoso
  • 343
  • 1
  • 6
  • 19
-1
votes
1 answer

Android setText in for loop to hold JsonObject values overwriting itself

I have been fiddling with this for a few hours, essentially what I am trying to do is create a JsonObject and get it's value inside a for loop and Set it to a TextView. It is working however I am getting only the Second loop values, to clarify this…
user1949387
  • 1,245
  • 3
  • 21
  • 38