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

Cannot setText inside a Fragment

I have a simple fragment that has EditText, Button, TextView . A simple string will be taken from the user and the TextView will be updated when the Button is clicked. But it is not working for me, my TextView disappears somehow. But if I don't…
Sanzid Sadman
  • 139
  • 3
  • 12
-1
votes
2 answers

setText returning error when attempting to input a string on an editText Kotlin

I am attempting to perform a simple mathematical operation on one editText field which changes the value of another editText field (a unit conversion calculator). inchesEditText.setText(String) = (metersVal.toString().toDouble() *…
Cam H
  • 1
  • 1
-1
votes
3 answers

How to fix 'Cannot resolve method setText(java.lang.String)' error?

I am a beginner at Java and coding. I don't know if this problem is occurring because I forgot something in the code or something is not correct in the code. I have already tried looking through all the questions on Stack Overflow that are similar…
Promediz
  • 1
  • 2
-1
votes
2 answers

Attempt to invoke virtual method on a null object reference when taking values from another class

I have a "game" with two classes, one that holds and manages the layouts and views and another one that should perform all of the calculations needed. Did not get very far because when I click a TextView instead of displaying a value, the app…
-1
votes
2 answers

How to set number value in to string settext in to textview

Am work same project and i download multicontact library it give me only contact name what i went is contact number i change string to int but it didn't work can anyone now way This is may code public class MainActivity extends AppCompatActivity…
-1
votes
4 answers

Android setText erases past data

Sorry, if this question seems too easy, but i'm new, and i'm still learning! What i want to do, is to setText to a textview. I want to print the first 5 strings of an arraylist. Therefore i have done the following: for (int i = 0; i < 5;…
Buster3650
  • 470
  • 2
  • 8
  • 19
-1
votes
1 answer

force close when editing TextView from different class

I want to edit TextView in Class A with data from spinner from Class B Class A TextView tvv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
-1
votes
2 answers

TextView.setText() Null Pointer Exception

I'm currently facing a problem when trying to edit the text of a TextView in the OnCreate method of an Activity. As I understand, setContentView must be called before trying to change the text, however I am still having trouble with this. Here is…
Sam
  • 348
  • 1
  • 10
-1
votes
1 answer

Tkinter - Updating text plotting using set_text

I have values in a 2D array which I ploy them using the following lines: t1 = [[self.ax.text(i+.2,n-.6-j,myArray[0][j][i]) for i in range(myArray.shape[2])] for j in range(myArray.shape[1])] and I'm trying to update them using this:…
philippos
  • 1,142
  • 5
  • 20
  • 41
-1
votes
1 answer

TextView is set to null when I assign it a textView ID

I am working on a project where I need 3 textViews to change when a button is clicked. Here is my MainActivity class: package davidferrara.insultgenerator; import android.content.res.Resources; import…
DaveMcFave
  • 232
  • 1
  • 4
  • 13
-1
votes
1 answer

Everything works until I use updateDisplay method, causing the app to crash

Everything appears correctly on the screen until I fill in updateDisplay() method with code to update my textViews using setText/get. The app does not crash prior to entering the setText/get code to update from the DarkSky API, but once entered the…
duhhsnail
  • 1
  • 2
-1
votes
1 answer

How to put cardviews textview values in edittext in a fragment?

I try to describe actually what i want to do using below image According to my image 2nd request details is a number of cardviews which is added onclick of Add button and when i click on editImageButton then all textview values will again put on…
-1
votes
5 answers

why does my app crash when I use the setText Mehod?

QUESTION: Why is my app crashing whenever I try to use the setText() method to assign random Numbers as my Buttons' text? My Goal is to set random numbers to the buttons and if the user clicks the button with the larger number, he/she is awarded a…
-1
votes
1 answer

Textview.setText throwing nullpointer despite the view being in the correct contentView

Before any of you tell me that this has been answered many times before, let me clarify most of those who've asked this question either gave the wrong view id or set a different ContentView than where the TextView was located. I have already used…
Ruturaj Gole
  • 111
  • 1
  • 11
-1
votes
1 answer

Setting text to a layout

In a class, if I want to set the text to the text value of a string I have, what is the code for that? I have: TextView textView = (TextView) findViewById(R.string.noFaceFive); textView.setText(textView); but setText says : The method…
Sapp
  • 1,793
  • 7
  • 29
  • 51