I have 2 classes: MainActivity and CustomView. I have an XML layout with this CustomView. I want to access all my MainActivity variables from my CustomView class and also to modify them, I tried to get the context but it didn’t work. MainActivity class: MyCustomView class: I also tried getContext which …
Tag: android
Cannot infer type arguments for ArrayAdapter
I am still playing around with my calendar, I already nearly managed to integrate the https://github.com/SundeepK/CompactCalendarView into one of my fragments. There is just one error left, i did some research, others got the problem too for example with ArrayList<>. Example code: The IDE says: Note: C:…
Android 6.0 multiple permissions
I know that Android 6.0 has new permissions and I know I can call them with something like this Today I saw a Google app which needs 3 permissions: contacts, sms and camera. It’s making a page 1-3 and calls them all together at the same time to activate. Can anybody tell me how I can call 4 permissions …
Is it possible to set transition speed/time in transition everywhere on android
I’m using Transitions-Everywhere for my app, and I wonder if I can set the transition speed/time of the transitions.. I have something like this: In short, I want the transition to be slower than the default, but I just can’t figure out how to set the speed of the transition! Answer You can set th…
How do I resolve “Duplicate files copied in APK META-INF/*”
I am working at a commercial android application. I am also using some libraries licensed under different license types some of them stating the following: If the library has a “NOTICE” file with attribution notes, you must include that NOTICE when you distribute (One of them is licensed under Apa…
Load multiple images with picasso – Android
I am trying to load multiple images from some urls using picasso library. So far I have tried this code: This code doesn’t work. When I run this code it doesn’t reach to any line within the Target interface. Someone have any ideas for why? Answer Maybe I’m missing something here, but I think…
valid JSON response issue [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 years ago. Improve this question I hav…
My android studio app crashes when I touch the screen
My app keeps crashing on the mainActivity screen everytime I touch empty space on the screen. I have three buttons, two radioButtons, a textview, and two editText fields; whenever I touch these my app works fine, but if I ever touch white space, then the whole app crashes. I have minSDk of 15 and targetSDK of…
Android Https web service communication (SSL / TLS 1.2)
In my Android application I’ve got to communicate with a https web service and read the response. I’ve informed the server configured SSL with TLS 1.2. I am using the following sample code to connect with the service (https get request), but only the devices that runs Android 5.0 or above can succ…
How to show Heads up notifications android
How to get a heads up notification.With below code i can only see three dots on status bar and a notification in notification bar. Answer I was having the same problem, but I was using the newer NotificationCompat.Builder() call which requires a channel ID from a NotificationChannel. The notification will onl…