help me, I’m a beginner, I’m trying to make an application in which there is audio that needs to be played, I try to use MediaPlayer, so that the audio can be played and paused, I have implemented …
Tag: android
How to use ArrayList get() method in Android Studio
I made a code using an ArrayList (short[]) in Android Studio but when I use the get() method it always return the last data stored and I don’t know why. I’m using two buttons, one execute adquirir_audio() just to store some values. The second one prints in the console the stored data using a for l…
Android Retrofit Call pass response.body() as paramater for processing
I’m wondering how to pass the response.body() as paramater in order to further process it. Since now i could pass it only to a Toast, or setText of a textView, and it works just fine. But if i try to pass it to a function which saves it to SharedPrefs or something like it just passes a null object. I
How to configure proguard to keep all classes in packages that contain a specific word in package name?
I am trying to keep all classes in packages that contain the word model in the package name. Eg – com.xyz.model, com.xyz.abc.model, com.xyz.model.abc All the classes in these packages should not be obfuscated. I tried using wildcard for package names but it isn’t working How to achieve the desired…
Is it required to specify type of data to both diamond operators while creating object?
I am creating an object of ArrayAdapter in Java(Android Studio) is it required to add String Data type to both sides inside the diamond operators? can anyone explain Answer No, you do not need to specify it on the right side. However, it won’t cause any harm if you specify there. Please read more about …
List All Data Using Retrofit/OkHttp With Response List
I have some codes that fetch some data from my API. My question is how can I list all the objects that I fetched before without using this jsonData.get(0), I expect something like jsonData.get(i), so …
How to priorly get future Glide image size which will be stored in cache in Android/Java?
In MainActivity, I’m loading some images using glide into recyclerview according to imageview size. See: XML: As you can observe, I’m using Glide cache DiskCacheStrategy.AUTOMATIC also so that next time without Internet Glide can show the images. Now you can read in this post https://medium.com/@m…
Arraylist error index out of bound or it is null
As we know there is no multi query option to firebase realtime database, so instead of using default FirebaseRecycler methods I am trying to manually feed keys from arraylist to the recycler view. In order to sort specific keys on the basis specific child nodes of the given parent I wrote below logic. If I tr…
Android Emulator stays with black screen after trying a lot of things to fix it
My Android emulator starts but do not progress from the black screen, it happened from one day to another a few days after installing Android Studio 4.0. I tried the next things: Reinstall completely from zero Android Studio Installing/Uninstalling Android Emulator, Intel Xahm, Android Platform Tools Creating…
Android ImageSpans in Codename One TextFields
I am porting my Android app to iOS and I am using Codename One for that. In my app an EditText can contain icons mixed with text. It is accomplished with instructions like these: MyImageSpan iconSpan=…