Skip to content

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…

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 …

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…