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
-2
votes
2 answers

How to read XML file and pass to setText as String with all tags and white-characters [Android]

I want to read XML file, save it as String and pass to setText. I don't want to parse it but see it on my smartphone screen with all tags and white-characters, eg. some text not: some text How to do it?
-2
votes
2 answers

settext for more than one edittext in vertical lines

I'm beginner in android development and i'm trying to build an app with multiple equations and i need the result to be viewed in one text and in vertical lines every result for equation viewed in line, i know how to show them together but it will…
mohamd jado
  • 23
  • 1
  • 1
  • 8
-2
votes
2 answers

txtt.setText(getString(R.string.("i" + j++)));

What's wrong with this code? I want to use id automatically. I think after R.string there is a mistake. What can ı do
-2
votes
5 answers

setText Method Crashes Android App

I'm writing an android app that needs to use setText() on a TextView, which should be easy, but every time, the app crashes right when it gets to the method. I have another app that I've coded exactly the same, as far as I can tell, (other than…
Paul
  • 1
-2
votes
1 answer

why text is texted wrongly in this method in android?

please help me! at first please follow this algorithm: 1- btn_set1 is clicked, its functions are doing. 2- btn_set2 is clicked, "text1" is SetText ed into "+"!!! WHY??? please help me, how can i solve this problem? thanks. public void onClick(View…
Mina Dahesh
  • 332
  • 8
  • 21
-2
votes
3 answers

Why can't I set text to an Android?

``Hi, i have a calculator application and on the screen there are buttons for number and add, multiplication, clean, substruction and division buttons. But when I open and click buttons they couldnt make change on editText. When i write number on…
Irem Herguner
  • 47
  • 1
  • 8
-2
votes
1 answer

TextView.setText() doesn't work

I've got an int i int i = 5; then I convert it into String str String str = Integer.toString(i); then I try to set String str to TextView tvEx tvEx.setText(str); And then my program break down. Can you help me? ExActivity.java…
Sergius
  • 521
  • 8
  • 21
-2
votes
5 answers

I have 200 textviews and i want to know which one was pressed then how to change the text

I have a problem... have been thinking about it for a while now and been looking on line and still haven't come up with a clear explanation... I have a number of textviews and have set onClickListeners to each of them.. and when the user clicks on…
Charlie
  • 170
  • 12
-2
votes
1 answer

Why setText() function doesn't work?

can u tell me why this code is not working? The app stops as soon as I click on Image(Imageview1). Debugger points to tv.setText(x); protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final TextView tv =…
-2
votes
1 answer

Jsoup and setText not working in android

Basically when I execute my app it either crashes, or does not display any text or anything. I am using fragments and viewPager in my main activity but the class that is causing the problems is this one: public class DailyWord extends Fragment…
user1825241
  • 846
  • 4
  • 9
  • 17
-2
votes
3 answers

EditText.setText() not working & getting wrong values from EditText

I'm a starter on Android, mocking a contact list of a phone. Now I have a contact list, like the pic below, when I press the one item of the contact list, it pops up a dialog with two choices. And if I choose "Add to Black", another AlertDialog…
Yuchun Cui
  • 69
  • 2
  • 7
-2
votes
1 answer

Second Datebtn.setText() inside switch case does not settext the selected date value & Datebtn text continues to show only the current date

I have tried this button.set() in multiple ways by doing this inside dateonset () method and I get a null pointer exception there though the editText4 contains the valid text to set the button. I tried the route of Shared preferences as I suspected…
-3
votes
1 answer

How to fix "NullPointerException" in viewmodel.setText?

I'm trying to pass the user information from MainActivity to one of the fragments in my NavigationHeader and i keep getting a NullPointerException everytime i try to setText in the Fragment. I tried using the Bundle and Interface approach before…
Speedy
  • 69
  • 8
-3
votes
1 answer

String resource ID error when setting text in edit text

I have the following code. if (j == 0) { // Age units. if (button.equals(findViewById(R.id.years))) q19Text.setText(yearsDiff); if (button.equals(findViewById(R.id.months))) q19Text.setText(monthsDiff); if…
Cody Harness
  • 1,116
  • 3
  • 18
  • 37
-3
votes
1 answer

Android Studio textview text isn't changing when I use setText in custom method

I'm using the following to change a symbol: private void updateCurrencySymbol() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); String symbol =…
Jackie Jones
  • 100
  • 1
  • 12
1 2 3
52
53