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

Android Method TextUtils.regionMatches

I has found this android method TextUtils.regionMatches But for some reason, so it is not clear how this function works. The function can be found…
FIG-GHD742
  • 2,486
  • 1
  • 19
  • 27
1
vote
5 answers

Matching only characters in sequence of a word from a given string

I am trying to find a closest match for a word by giving a specific string, for example: so I would have: "jonston" x "john" => "jo" //only "jo" is the part that matches "joshua" x "john" => "jo" "mark" x "marta" => "mar" as you can see I only…
zanona
  • 12,345
  • 25
  • 86
  • 141
0
votes
1 answer

Cannot use any variable as argument to .setHint()

// This is in the class which calls the next activity with an intent: Bundle bundle = new Bundle(); bundle.putCharSequence("Hint", "test"); startActivityForResult(new Intent(this,…
Tombola
  • 1,131
  • 5
  • 15
  • 26
0
votes
0 answers

Android(4)-Java: Why is DateFormat incorrect? cannot be referenced from a static context CharSequence format=DateFormat.format("yyyy-MM-dd_HH:mm:ss");

I tried to make screenshot programatically according to this video but there is error with CharSequence format: error: non-static method format(Object) cannot be referenced from a static context CharSequence format =…
Dominik
  • 55
  • 1
  • 2
  • 7
0
votes
1 answer

How can I use this equation in my TextView?

I'm currently sharing code between activities and on this activity I wrote a function with all the shared data and I am trying to put the outcome of this function in a TextView. But it says it's expecting CharSequence! and that I have type Double.…
JenairoB
  • 3
  • 2
0
votes
0 answers

Difference between CharSequence and Sequence in Kotlin?

In Kotlin, a Sequence is a container whose operations on it (like map, filtering, etc..) are done lazily. Like Java Streams. A CharSequence is just a supertype/interface of several String-like types, like String, StringBuilder, etc.. So a…
Hector Ricardo
  • 497
  • 5
  • 16
0
votes
3 answers

What is the need for Name interface in Java?

In Java, when is the interface Name (which extends CharSequence) useful? Why not just use final String instead? I do not see any classes that implement Name. Alternatively, what I am interested is the use cases of Name, CharSequence, and the String…
Aria
  • 176
  • 2
  • 10
0
votes
3 answers

nullPointerException when replacing char sequence

I developed a very simple android app and then I obfuscated the code. A nullPointerException is throwed when, probably, I replace a char sequence. Here is my stack trace: java.lang.NullPointerException at…
yugidroid
  • 6,640
  • 2
  • 30
  • 45
0
votes
0 answers

Join an array of CharSequence into a string

I am a newbie in Kotlin, sorry for the silly question. Inside a bundle from a StatusBarNotification object I have found an array of CharSequence, or at least I think that the type is that one. In the image you can see a screenshot which shows the…
Nisba
  • 3,210
  • 2
  • 27
  • 46
0
votes
1 answer

How to test if a textview contains a specific link?

I have a textview with link included as an a tag. In string.xml I have string like this - This is my text view with link I want to programmatically check whether textview has this link and whether it is clickable. If I try using…
Mayank Kumar Chaudhari
  • 16,027
  • 10
  • 55
  • 122
0
votes
3 answers

.text does not print anything, yet .append does

private fun testing (data: CharSequence) { runOnUiThread{ test!!.text = data textView!!.append(data) } } Two different textViews called test and textView. My goal is to use .text to print the data…
0
votes
1 answer

Calling setText("") app getting crashed or How can i set CharSequence NULL value

Calling setText("") app getting crashed or How can i set CharSequence NULL value. Whenever i have only one character in the EditText and using Key Stroke backspace my app getting crashed. I have an EditText with below code: bid_four =…
0
votes
2 answers

Android Alert Dialog Box Not showing Up Whats Wrong?

I was following a Youtube tutorial to show alert Dialog Box on my View Holder.In order to send the user to a Specific Activity based on their selection.But when I click on the View Holder it is not even showing up or doing anything.However the…
0
votes
2 answers

How to compare string values of CharSequence[]?

I have the following CharSequence defined: final CharSequence[] videoQualities = {"any", "medium", "high", "hd"}; I am getting two string values: availableQuality and requestedQuality. Both can contain values from the CharSequence above only. How…
LA_
  • 19,823
  • 58
  • 172
  • 308
0
votes
1 answer

static final CharSequence to R.string.xxx how to do it properly?

I wanna change hardcoded TITLE to resource from strings.xml How to do it properly? public static final CharSequence TITLE = "Home"; @Override public CharSequence getPageTitle(int position) { switch (position) { case…
Lojma
  • 1
  • 2