Skip to content
Advertisement

Tag: android

What is the alternative in Harmony OS for Nullable and NonNull annotations?

There are many arguments in my code which can take the value null. It would be helpful if there is a @Nullable and @NonNull annotation like the ones offered in Android via Annotation. Is there an alternative available in Harmony OS? Answer You can use org.jetbrains.annotations.Nullable & org.jetbrains.annotations.NotNull annotations available from jetbrains dependency, implementation ‘org.jetbrains:annotations:20.1.0’

DataModel cannot be cast to java.util.ArrayList

I couldn’t find what the problem is. Logcat is saying : “Caused by: java.lang.ClassCastException: com.example.project.model.DataModel cannot be cast to java.util.ArrayList” I tried different solutions but none worked: Parcelable @SuppressWarning Could someone show me what is wrong in my code please? DataModel.Java TableActivity.Java DetailsActivity.Java Answer You are passing object on intent by doing this, and on receiver side, you are expecting

How to update the the bitmap image inside the FirebaseStorage in android without changing its downloadUrl in the realtimedatabase

I want to update the bitmap image inside the URL without changing its download URL in the real-time database because at uploading for the first time I have uploaded the image in the storage and stored it URL in the real time database now I want to update that image how should I approach this ?? above written code was

Unable to add more than one item in a listview

I am working on a tasks app, for which I created a list view that shows list items consitsting of task names, their priority etc. The data given to the list view is from an sqlite database. I, however, am unable to add more than one item to the list. I have no idea why. I have created a method

android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify

After upgrading to android 12, the application is not compiling. It shows “Manifest merger failed with multiple errors, see logs” Error showing in Merged manifest: Merging Errors: Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined.

Update default Content-Type for multipart form-data request in Android

We are currently using okhttp3 and retrofit2 in Android to make an network api call of type POST with multipart/form-data, the api request and response are as shown below If you observe, the request header Content-Type has “multipart/form-data; boundary=xxxxxx-xxxx-xxx….” Following is the code I’m facing an issue with sending the customised request header Content-Type as “multipart/form-data; **charset=utf-8;** boundary=xxxxx-xxxxx-x…..” basically i

Advertisement