I want to show the data I have stored in Firebase Realtime Database by filtering according to the date of the users. My data in the database always works according to GMT+3 timezone. But if my user’s time is different from GMT+3, the query will not work correctly. I need some information and code for th…
Tag: android
How can I run a java.class from Main Activity
I’m a beginner at Android Development and hoping someone can help me a bit out. I want to connect to a local server (IP). I found a code in GitHub that supposedly would do this connection. But the thing is that this is a java.class and not in my MainActivity. So when I run my app in the emulator now,
How to filter a listview using SearchView
I am using searchView to filter my list view. But the problem is only when I write the full element name then only the list is filtered. For example: I have a list of users – {“Bob”, “John”, “James”}. If I write J in searchView I want both John and James to be seen. B…
android-youtubeextrator: java.io.FileNotFoundException Error
I am getting java.io.FileNotFoundException error while trying to download video from youtube using android-youtubeextrator lib. Full error code: My Download Function: I tried changing the version of android-youtubeextrator. Still it is giving same error. Please help. Answer you can track the same issue on the…
Android application with MVVM architecture, writing to local Room database from a Service using MVVM, how should the Service write to the database?
In MVVM we have Activities and Fragments. Fragments and Activities have access to ViewModel. ViewModles have access to Repository. Repository has access to local and online database. I want to build a Service component so that when the application is put on background the Service should continue to write to t…
Date picker Dialog shows only one date
I am trying to implement the date picker dialog but the dialog appears with just a single date and show rest of the date as blank what could be the reason? Answer This is definitely a Theme issue. The selected date is visible because of the contrast in text color and circle color. You can refer this link for …
findViewById not accepting type argument even with compileSdkVersion 30
I generally use kotlin for android but my college wants me to use Java. So I created a new java project in android studio. The problem is I don’t want to cast the return value of findViewById() manually. Instead I want to pass EditText as type parameter which the function is not accepting as anticipated…
Dismiss alert dialog after time
How do I add an automatic dismiss dialog after a time to the show alert function? Answer Handler class provides a method called postDelayed(). It allows us to dealy an event (in your case, event is to dismiss the dialog).
Android-How to create a new writeable file?
I have a jobIntentService that create a file to add some text in it but I get the error /data/user/0/com.example.projet/files/log.txt (Is a directory). I don’t know what I did wrong… Here is my code : Furthermore, what I want is a sort of log file so I want to access it from the phone but /data/us…
Android Studio error in build – Cause: startElement.getAttributeByName(QName(“name”)) must not be null
I want to create a spinner widget, and I added this to string.xml: and I adapted it: and I got a build error: How can I solve this? Answer Special character like apostrophe(‘) are not allowed in xml directly Use can use escape sequences to get the desired result. Replace: Today’s by Today ‘…