Questions tagged [charsequence]

In Java (and related languages such as Scala), java.lang.CharSequence is an interface to sequences of character values.

For more information, see the Java 8 specification of CharSequence.

146 questions
-1
votes
1 answer

Android Volley Converting ArrayList to CharSequence Returning Empty

In the onCreate method, I have a network operation that is to return JSON that is parsed into ArrayLists, to be set into a CharSequence[] array and used in an alert dialog. However, when selected, the alert does not populate with the resulting JSON…
Sauron
  • 6,399
  • 14
  • 71
  • 136
-1
votes
1 answer

Android EditText Money Input Style Without Dollar Symbol

I want to money input box without dollar symbol. There is a code which works fine with dollars private int price = 0; @Override public void onTextChanged(CharSequence s, int start, int before, int count) { …
John Error
  • 2,076
  • 5
  • 18
  • 23
-1
votes
1 answer

How can I use " getCharSequence " in this code?

I have this code for sending a text is selected from first textView to second textView with clicking on a button : txt=(TextView)findViewById(R.id.txt); txt2=(TextView)findViewById(R.id.txt2); btn=(Button)findViewById(R.id.btn); …
Ehsan
  • 5
  • 8
-1
votes
2 answers

Convert ArrayList to CharSequence[]

I have a custom ArrayList and want to convert it into CharSequence[]. I tried this List list = Arrays.asList("foo", "bar", "waa"); CharSequence[] cs = list.toArray(new CharSequence[list.size()]); System.out.println(Arrays.toString(cs)); //…
PsyGik
  • 3,535
  • 1
  • 27
  • 44
-2
votes
1 answer

How to add data into a CharSequence

I got a list List paths = {"r", "e","t","t"}; and I want to add the data of paths into a CharSequence. I have done this code: CharSequence[] cs = paths.toArray(new CharSequence[paths.size()]); but I don't know how to add the data in,…
Ricky Zheng
  • 1,279
  • 3
  • 16
  • 27
-2
votes
1 answer

what is editText's data type in android studio?

I'm trying to copy some text from an editText field in android studio but the app always crashes when I do. copying works fine, what crashes the app is copying from editText. I assumed it is String and tried casting it to a CharSequence, still…
kuha
  • 1
  • 1
-2
votes
1 answer

'toString().contains()' method unable to detect '˚' (degree symbol) inside a CharSequence

I have a CharSequence which contains two ˚ (degree) symbol inside it. I have written an if statement which detects what's inside this CharSequence like this: CharSequence name = "27°46'29.6"N 77°19'05.9"E"; if (name.toString().contains("˚") { …
Hammad Nasir
  • 2,889
  • 7
  • 52
  • 133
-3
votes
5 answers

Facing problem while implementing interface in java

I have studied that "A class that implements an interface must implement all the methods declared in the interface" I am doing the study of CharSequence from this link here CharSequence having 4 methods, according to the definition of the…
gautam
  • 522
  • 3
  • 14
-3
votes
3 answers

How to retrieve string value of text view and again set calculated double to that text view in android?

my project contains the grid view in which i created the custom view. Custom view had minus button, text view and plus button. My intention is like that, when i press on minus or plus button, the value of text view get changes according to some…
sid
  • 157
  • 1
  • 1
  • 10
-3
votes
2 answers

How to change the android:text of a textView

I am having trouble changing the text inside my textview. I want to have the textview contain the string "foo \n bar \n foo2 \n bar2" and I want to be able to add and take away lines from the textview. I can manually type in "foo \n bar" in the…
Mac
  • 15
  • 3
-5
votes
2 answers

How do I set the text of an Android TextView from Java?

I am currently working on an Android application where I am changing the text in a TextView object while my app is running, from within the MainActivity class. To do this, I am using the setText(CharSequence text) method. This method's documentation…
1 2 3
9
10