Posts by Ivan Silva • 820 points
46 posts
-
0
votes1
answer123
viewsA: What’s the best way to check if a collection exists in the cloudFirestore (Android)?
Hello, André! onFailure is only called if the Firestore request fails. To find out if something exists, you need to wait for the callback to be successful in onSuccess. To solve your problem, wait…
-
0
votes1
answer125
viewsA: How are these Setters methods not being used?
So come on Edielson! First let’s be clear: the fact that the methods are dimmed only indicates that they are not being used. It is not an error. Done, let’s get to the real problem. The problem Your…
-
0
votes2
answers187
viewsA: Android - How to create a comparison so that items from LISTVIEW are displayed or not according to the date?
To use this solution, you will need to use a Adapter customized one more RecyclerView. Backup your current code before making these changes. 1 - Replace your ListView by a RecyclerView…
-
0
votes1
answer71
viewsA: How to open Webview in the last URL accessed
Hi there, Leonidas! Since you say login is just a nickname, I will consider that the security level should not be a problem. That way, we can solve your problem as follows 1 - Create a method to…
-
2
votes1
answer415
viewsA: How I Upload Multiple Images Automatically to Firebase Storage - Android Studio
Hello, Luana! This may not be the best method, but I think it will solve your problem. First we must realize that so far, the SDK of Firebase Storage does not support uploading multiple files at…
-
1
votes1
answer24
viewsA: Activity is not showing button
Hello, Cicero! You need to add the button to the layout. Try this @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
android-studioanswered Ivan Silva 820 -
1
votes1
answer44
viewsA: Viewmodel connection to Repositorio
Hello, Vinicius! Considering high cohesion and level of involvement the response is nay. In your code, you delegate tasks to ViewModel which relate to the Repository. How do you consider the use of…
-
0
votes0
answers52
viewsQ: Changes lost in merge
Guys, I merged wrong and all the new changes were lost. And the commit before the merge was two months ago. The sad question is: all the changes were permanently lost? Log commit d52ac4b.....3ccf2a…
gitasked Ivan Silva 820 -
1
votes1
answer559
viewsA: Change background when clicking and then return the original color
Hello, Edi! If I understand your problem correctly, you need that when you click the previous background color back on the button again. So, do it this way 1 - Create a selector for each button, if…
-
0
votes1
answer51
viewsA: Android - Convert arrayList to String []
Good afternoon! Try with the class ArrayUtils as follows String[] fruitsArr = ArrayUtils.toStringArray(fruitsList);
-
3
votes2
answers52
viewsA: How you use < as text
Good morning, Thales! Try it this way <O Majestoso> This way the browser understands that these characters should not be interpreted as a tag HTML. For future inquiries, you can visit…
-
0
votes1
answer275
viewsA: Query search android studio, firebase data listing problems
Hello, Marc! To recover the nome, you will need the key group name. I would look more or less like this, for example, to get the group name mDatabaseRef.child("grupos") .child("-L_KE54XVwBMans6Bh6")…
-
2
votes1
answer40
viewsA: Edittext via Java
Good morning, Michael! You can create Views programmatically (using Java). For example EditText etUserName = new EditText(getContext()); How are you creating a View custom, pass the context to the…
-
1
votes1
answer749
viewsA: FATAL EXCEPTION: main Process:-When I opened the application give ANDROID error
Hi, Daniel! Try it this way @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.alunos); Toolbar toolbar = (Toolbar)…
-
0
votes2
answers1216
viewsA: How to call Activity/Fragment when clicking the button? Android Studio
Good night, Michael! Generally, you should reference your Views in the method onCreate of his Activity. In the case of the library, you can use it as follows Get your View, the button, and tell your…
-
1
votes1
answer64
viewsA: Mainactivity recognizes methods from external classes
Good night, Wesley! Simply call your method within another, that way public class MainActivity extends AppCompatActivity { Casa c = new Casa(); // Mudei de posição apenas por questões didáticas…
-
5
votes1
answer78
viewsA: How to iterate inside a list that is inside another class?
Hello, Breno! Get the class list User as follows User user = new User(); List<Post> posts = user.getUserPosts(); Now you can use the list of Postas you wish for(Post p: posts) { // p é um…
-
2
votes2
answers42
viewsA: Uncaught Syntax error when assigning Object values in Javascript
Hello, little headlight! The warning VM200:3 Uncaught SyntaxError: Unexpected token + It says that there is an unexpected token, in which case it is the plus sign. You cannot concatenate the name of…
javascriptanswered Ivan Silva 820 -
0
votes2
answers179
viewsA: Should I put "Event listeners" inside the "Document ready" function?
Hello, Thiago! When you do $(document).ready(function(){ $('#elemento').on('click', function () { ... }); }); You ensure that the event is only available when the document is fully loaded. But…
-
1
votes1
answer51
viewsA: How do I manipulate a date in an Edittext to add up to 1 day?
Hello, Try as follows, get the value of your EditText that will come in the form of a String. Then we turn that String in a type object Date String dateValue = seuEditText.getText(). .toString()…
-
1
votes1
answer40
viewsA: Error when routinely attaching to button
Come on, Iago, come on! Avoiding an extensive discussion in the comments, I will try in a reply, embed two solutions. In a first scenario, where the Button is located in the Fragment like you said…
-
2
votes1
answer224
viewsA: Wait Reply Alertdialog
Come on, Leonardo! If I understand your problem correctly, we can solve it this way @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) {…
-
0
votes1
answer54
viewsA: Notification by the logged in user account
Hello, Caio! 1 - About your question code example: mNotificationManager.notify(id, mBuilder.build()); the id which you refer to is just an internal identifier for if you want to update your…
-
2
votes2
answers296
viewsA: Inserting data into an Arraylist
Hello, Bruno! To solve your problem, replace the method ArrayList.addAll() for ArrayList.add(), thus Replace that public void inserirDados(int matricula,int mes, int dia) {…
javaanswered Ivan Silva 820 -
1
votes1
answer29
viewsA: Doubt about variable declaration
Good night, jezq! I have no experience with Javascript, but as far as I know, function abrirPopUp() { janela = ...; } The variable janela is global which means it is accessible anywhere in your…
-
0
votes1
answer449
viewsA: Set text of selected item in Spinner for an Edittext
As you request, you need to get the selected item from Spinner. Remove his instantiation from within the method editTaskDialog and put in the onCreate of Activity @Override protected void…
-
1
votes1
answer179
viewsA: Remove Title from menu bar
Try this Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle(""); Or so Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);…
-
0
votes2
answers124
viewsA: Valueeventlistener coming back null?
Hello, First, there’s a big mistake in your code, don’t call Real-time Database within your adapter, this way you will not be able to properly address the call return and the life cycle of the…
-
1
votes2
answers58
viewsA: How to use Vectors for Instacing in JAVA?
Good afternoon Herbet, You could create a array with the type of class representing the player and go saving in it Player[] players = new Player[100]; players[0] = player; To retrieve/modify objects…
javaanswered Ivan Silva 820 -
0
votes2
answers105
viewsA: Change Textview with Listview event
Use an interface and make your Activity watch the change. public interface Observer { void onChange(Soma soma); } Then make your Activity implement the interface Observer and pass a reference to the…
-
0
votes1
answer239
viewsA: Like button with jquery
Hello, Ya Oliveira! The code I will post will be very basic, it serves as an example. 1 - Let’s start by creating a page html <!DOCTYPE html> <html lang="pt" dir="ltr"> <head>…
-
2
votes1
answer81
viewsA: Filenotfoundexception - Android Studio
To read or write to external storage, you must request permission. <manifest ...> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> ... </manifest> For…
-
1
votes1
answer58
viewsA: Nullpointerexception when trying to use interface to pick up data from one Ragment to another
I believe your problem can be solved by implementing the standard Communicator. The flow between the Fragments should always go through Activity. I will omit parts of your code to clarify the…
-
1
votes3
answers63
viewsA: Java Doubts - Creating Classes(Objects)
Come on, I’ll try to be as clear as I can. If I create a Minhacalcular Object(Class), the default value of this object will be 0 or null? When you create a new object it cannot be null. This is the…
javaanswered Ivan Silva 820 -
0
votes1
answer173
viewsA: How does an object return using addListenerForSingleValueEvent from fire base?
When you call getDadosUsuarioLogado(), the return will always be null due to the call to the database being asynchronous. For you to get the returned object, do the following: Create an interface:…
-
1
votes2
answers235
viewsA: How to convert byte[] to mp3
That solved my problem. try { ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream(); InputStream stream = pssu.openStream(); File mp3 = new File(getFilesDir(), fileName.toLowerCase());…
-
0
votes1
answer51
viewsA: How to share Bitmap Generated Image
You can pass a Intent being in charge of the user choosing which application he wants to complete the action with. See if this solves his problem: Intent intent = new Intent(Intent.ACTION_SEND);…
-
1
votes1
answer878
viewsQ: Internal Storage - open failed: ENOENT (No such file or directory)
I have a problem that I haven’t been able to solve for a few days. I have a list of files that are saved in Internal Storage and what you need to do is zip those files when users leave the activity.…
-
0
votes2
answers235
viewsQ: How to convert byte[] to mp3
I’m writing an app where I have a list of byte[] and need to create files .mp3 from these byte vectors. When prompted, the app zips all these files into one file .zip, but later the player is not…
-
1
votes0
answers24
viewsQ: Watson Speechtotext crash app android when Microphonehelper is called
I cannot start the audio recording. I am receiving the following error: E/AudioRecord: start() status -38 E/AndroidRuntime: FATAL EXCEPTION: Thread-7713 Process: com.sienaapp.sienaapp, PID: 5005…
-
2
votes1
answer20811
viewsA: Forced cancellation of an existing connection by the remote host
After many searches, I finally solved my problem based on a response from the Unity forum. This happens due to the instability of the device in relation to the USB connection. So, in this case, the…
-
0
votes1
answer887
viewsA: How to create a custom Listview inside a Fragment?
First of all I would advise you to use Recyclerview which is much more performative and powerful. You can read more about it here:…
-
1
votes1
answer31
viewsA: How do I download a file that is in Storage by my app (Adnroid Studio)
Salve @Developd, 1 - First thing to do is select the image you want to upload. @Override public void onClick(View v) { switch (v.getId()) { case R.id.fb_upload_profile_image: Intent i = new…
-
2
votes1
answer20811
viewsQ: Forced cancellation of an existing connection by the remote host
So guys, I’ve been breaking my head with this problem in Android Studio: 1 - I’ve already started adb:…
-
0
votes1
answer499
viewsA: Populate Arraylist dynamically ANDROID STUDIO
Come on... The first thing in mind is to have to upload the Firebase data. Remembering that this is not the best way to access your database. It’s just the most rapid from the point of view of…
-
0
votes1
answer156
viewsA: How do I work with Firebase Storage offline?
Unfortunately, the Firebase Storage SDK does not yet offer this feature. But nothing prevents you from implementing your own solution to persist the files locally while the device is disconnected.…