Skip to content
Advertisement

Tag: android

How to fix the Issue with replacing AsyncTask to connect socket?

I’m trying to use This approach(Marked Answer) to replace my code with AsyncTask to make connection between user in android and server, And here’s what I’ve done : Note: I’m not using any specific pattern, just trying to achieve this goal on a basic structure. MainActivity : ClientConnection : ConnectionTask : ConnectionRunningTask: So base on the above code I’ll try

What code solution to these ranges in java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year. Improve this question Hello I would like to make a method that takes a given weight and windspeed and picks the right kite. The

Cannot resolve class TextView, ImageView, LinearLayout,

When I want to create TextView, ImageView and … in my file xml, everything turns red and tag style appears instead of height and width the I have to copy and paste any features manually. The app will run although everything is red, like the attached photo. I also have cleared the cache through File ->Invalidate caches but the problem

Sorting arraylist and returning an arraylist (not a list) – Kotlin

I’m trying to display sorted information using a RecyclerView. To do so, I’ve got an ArrayList of custom datatype. I want to sort the data in the ArrayList by descending order, using one of the fields in the ArrayList. I’m familiar with the methods that are already available (sortWith, sortBy, sortByDescending, etc) but unfortunately, they all change from ArrayList to

Android 12 – Fatal Exception: android.content.res.Resources$NotFoundException

I’m getting the below error on Android 12 devices. Any help is highly appreciated. Thanks in Advance. Answer This is an upstream bug on Android 12 + Samsung devices, Chromium team and Samsung are aware. Star this issue to follow along: https://bugs.chromium.org/p/chromium/issues/detail?id=1271617 Until then, add platform-specific / vendor-specific disable of WebView usage or your app will crash out-of-process (in the

android firebase start listing data equal to entered letter

There is a problem with the list inside the “if” it doesn’t work I get an error this:java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List Answer You are getting the following error: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List” In the second if statement, because the type of the “name” field in the database is String and not a List, hence

Loop Object from a single Array

im sending a Json Array from Activity A to Activity B, and i want to populate that Json Array into Spinner in Activity B. but when i Log the json array from Activity A, the data becomes a single object “NVAKSINATOR” : [{“NVAKSINATOR”:”[{“NVAKSINATOR”:”20800″},{“NVAKSINATOR”:”0″},{“NVAKSINATOR”:”77350″},{“NVAKSINATOR”:”51750″},{“NVAKSINATOR”:”30000″},{“NVAKSINATOR”:”51500″},{“NVAKSINATOR”:”25750″},{“NVAKSINATOR”:”30900″}]”}] i want that number like 20800 , 0 , 77350 to be populated in spinner but i

How to arrange list item in spinner in ascending order

How to arrange items in list descending instead of the image: to be like this: and this is the below adapter I use: and this is the setupPrice() method which I need to arrange the entities in: Answer You can implement a Comparator like this for your Sm class before passing it into the adapter. Just like what the first

Call method in Fragment from some class

I’ve been working on Android App in AndroidStudio. Application has Fragment, let’s call it MainFragment, and seperate Java Class file, let’s call it SQLiteControler.class The problem is when i try to call method from Fragment in SQLiteController im getting null object reference as error Here is some minified code: MainFragment SQLiteController Note: This is minified code I have tried, a

Advertisement