Questions tagged [getstring]

150 questions
1
vote
0 answers

getstr is returning an empty string in python curses

I am trying to make a basic TUI for an ultrasonic sensor for a Raspberry Pi. I am having problems getting user input from getstr(). The program allows you to type and enter values but it returns an empty string. Here's the code for the…
1
vote
4 answers

Can't put column name into GetString

I have got this code: public void chyt_data() { try { SqlCommand novyprikaz = new SqlCommand("SELECT * FROM zajezd WHERE akce=" + currentrowstring, spojeni); spojeni.Open(); …
Marek
  • 3,555
  • 17
  • 74
  • 123
1
vote
1 answer

JSON getString() removes spaces from string?

I have the following JSON data : { "customer": [ { "cus_name": "ravi sharma", "cus_email": "sk@yahoo.com", "cus_pass": "pass", "cus_mob": "91111111", "cus_add": "new delhi…
user2350535
  • 15
  • 1
  • 6
1
vote
1 answer

getString method in android does not work

This is our main class to get information from the database. We are trying to get the values of the "name" column in the "barcode" database that we have created. Right now, we are not able to get the desired value but values as "a, b, c, d, ..."…
1
vote
1 answer

The method getString(int) is undefined for the type GamePlay

I'm having a problem while using the getString function for reading a string located in the values folder. I get the next error: The method getString(int) is undefined for the type GamePlay It is complicated for me because I want to call this…
user2204353
  • 195
  • 1
  • 2
  • 10
1
vote
3 answers

android: getResources().getIdentifier NotFound Exception

I get my Data via json. Put it in a Hashmap und list it in a ListView. That works fine! Now I want something like this: String myArt=report_TJ_+e.getString("artID"); That does not work in my combination. Here is my Code: try{ //String text =…
sarahsdev
  • 177
  • 6
  • 22
1
vote
2 answers

getstring() from a call without extend activity

I have a problem with a simple class that contains information that I will like to call from another class. For example here is the class Util which contains the info: public class Util{ public ArrayList getRellenas() { …
Txispas
  • 159
  • 4
  • 14
1
vote
3 answers

How to compare with getString() string.xml and String Object?

I have a problem with comparing strings: I get the string value of "activation" in string.xml. When I compare it with a string value that has the same value, the result is always false (in string.xml activation = test)
0
votes
3 answers

Difference between R.string.xxx and getString(R.string.xxx)?

What is the difference between two ways to obtain a string from resources: setPositiveButton(R.string.some_string); OR setPositiveButton((getString(R.string.some_string)); ? In both cases I get the same result.
sandalone
  • 41,141
  • 63
  • 222
  • 338
0
votes
1 answer

How reference String in SQLiteOpenHelper

I have an activity that extends SQLiteOpenHelper and i want to reference a string from resources in my strings.xml when i use: Resources res = getResources(); String Note = res.getString(R.string.M1Details); i get error: The method getResources()…
Richard Suarez
  • 109
  • 1
  • 10
0
votes
2 answers

Actually displaying my SQL Database value on my application, not the location

Basically, I want to return the actual value in the database and not the position that is currently being pointed to. From reading up on this, the getString method seems to be the guy that I need, but that doesn't seem to be working. Here's the…
Creights
  • 907
  • 1
  • 12
  • 25
0
votes
0 answers

Uri(getString(R.string.link.mp3)) in broadcasg reciever

I have created a fragment and brodcastreciever.I want to initialize exoplayer and its mediaitem from uri.broadcastReciever.I need to setUri by using getString(R.string.text)
0
votes
1 answer

Resources and getString() returns wrong translation of text

Inside my Fragment I fetch a string which returns French translation but I want it to return English translation. What I noticed so far: binding.textView = resources.getString(R.string.displayText) // returns French translation binding.textView =…
Targetbus12
  • 75
  • 1
  • 5
0
votes
0 answers

Android Studio: How to send data from Activity to Fragment | Method invocation 'getString' may produce 'NullPointerException'

I am having a problem where in the Fragment the "getString()" says "Method invocation 'getString' may produce 'NullPointerException'" that's the only problem. The Fragment is stored in MainActivity in Navigation Window. LoginActivity (Where…
0
votes
1 answer

ListPreference coding value not executing inside if statement

Can you check my code for anything missing? I'm trying to get use the value from a listpreference in an if statement but the if statement never responds to the value stored in the listpreference. Here the coding I'm using: String…
Emad-ud-deen
  • 4,734
  • 21
  • 87
  • 152