I’m trying to get some text from my website and toast it, but I get android.os.NetworkOnMainThreadError when running var str = URL("https://server.necrodragon41.repl.co/server/connect").readText(Charset.forName("ISO-8859-1")) Toast.makeText(applicationContext, str, Toast.LENGTH_SHORT).show() And the app crashes. Here is my code: RegisterBtn.setOnClickListener { if (day.toString() != "0" && month.toString() != "0" && year.toString() != "0") { try { var t = Thread(Runnable { ..
Category : string
Is it possible to manipulate Ussd code from an App, like for instance I was just thinking about an app that can automatically type and answer Ussd digits Source: Android..
I want my text to have ‘ but when I add it to strings.xml I have to add before, and is visible on textview, how to fix this? Source: Android..
website looks somewhat like this: dynamic webpage i need to copy all text from a dynamic webpage[keeps changeing for each second like there is a countdown/loading] for each second to a string previously i tried this code, private class BackTask extends AsyncTask<String, Integer, String> { @Override protected void onPreExecute() {} protected String doInBackground(String… address) { ..
I’m trying to change a bit display of string in android app. Now I’m using this string value : <string name="percent_off">%s OFF</string> But I wish it would return "- %s %". eg. "-54% " I have tried <string name="percent_off">- %s %</string> and <string name="percent_off">- %s %</string> But itseather crushing or not displaying any value at ..
I’m relatively new to Java so I’m kind of lost here. Is it wrong when you are trying to compare two strings just use the identical symbol "==" instead of using a method for checking if two strings are identical. Because for what I have tried the first option doesn’t work and I’m very curious ..
Want to know which method is faster in android. Just for knowledge. TextView t; t = (TextView) findViewById(R.id.TextView_ID); int number=5; t.setText(""+number); or t.setText(String.valueOf(number)); Source: Android..
I would like to return true if string starts with "{SOME_STRING}". examples of true returned: {A} {AB} {} {ABC} otherwise, return false. I tried: return str.matches("{%s}") but it doesn’t work I tried: return str.matches("{//s}") return str.matches("^{.*}") nothing worked. Source: Android..
I need Java code to place it inside a button in order to transfer text from Edit text and put as comment on YouTube video Source: Android..
I’m getting concurrent exception replacing string inside iterator. fun replaceValuesInURLString(allFieldsValues: HashMap<String, UserSelectedData>, urlString: String): String { var result = urlString val iteratorValues = allFieldsValues.iterator() while(iteratorValues.hasNext()){ val fieldValue = iteratorValues.next() val key = "$${fieldValue.key}$" result = result.replace(key, fieldValue.value.getDataForReg()?: "") } //Regex replace to remove query param value’s which are not replaced by earlier code val cleanUpRegex ..
Recent Comments