Posts by Vinicius Petrachin • 115 points
11 posts
-
0
votes2
answers1073
viewsA: How to do zip validation for Android
You can use this class available on Github as an example project. String zipcode = editText.getText().toString(); Pattern pattern_zipcode =…
-
0
votes3
answers345
viewsA: Get external IP in Java - Android Studio
I made a solution to check if the client uses proxy, before it was 2 methods, one to get the ip and one to test it. This way you already do both. RequestQueue queue; StringRequest proxyRequest,…
-
0
votes1
answer102
viewsA: I cannot "recover" the Realtime Database (Firebase) value
What value do you want to get? There it will try to return the user value, but if null can happen a Nullpointerexception. dref.addValueEventListener(new ValueEventListener() { @Override public void…
-
0
votes1
answer151
viewsA: How do I check if a switch is activated?
You have to add a Switch is the best way in my opinion, because so whenever it changes, it triggers an action. switchQuarto.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {…
-
0
votes1
answer74
viewsA: Recover the amount of children who have a knot
Your question has been answered. https://stackoverflow.com/questions/48645172/how-to-get-count-of-nested-nodes-of-a-parent-node-in-firebase I tested here and this code below was the one that best…
-
1
votes1
answer76
viewsA: How to get html code through a url in android studio
The most practical way I’ve found of doing this is as follows. Add in your Radle dependencies the code below: implementation 'com.koushikdutta.ion:ion:2.1.8' From Sync, then import the two libraries…
-
1
votes1
answer67
viewsQ: Firebase database reset data when soon
I was studying Firebase and created a login method with email and password, but I did not want to use this, so I learned to use Google Auth, so I decided to associate the google auth account in the…
-
1
votes1
answer144
viewsQ: How to use the Strings file inside the code
Hello, inside the Mainactivity XML in Android Studio I can use @string/STRING I would like to know how I would reference a string I have inside the strings.xml in the res folder of Android Studio.…
-
1
votes2
answers218
viewsA: App hangs after ending loop in Thread
I read Carlos' comment, and tried and went wrong, after that I added the loop control variable to be declared at the beginning of the code and in the loop I used only for(i = 0; i < words.length;…
-
0
votes2
answers218
viewsQ: App hangs after ending loop in Thread
Hello, I made an app in Android Studio that breaks the phrases in words and stores in an array using split. Then I made a loop of repetition using while so that it displays word for word, but there…
-
1
votes3
answers797
viewsA: How to consider an empty Edittext as "0"
None of the above corrections worked for me. Only this: if(txtEdit.getText().toString().equals("")){ num = 0; } else { num = parseInt(txtEdit.getText().toString()); }…