Posts by Edeson Bizerril • 661 points
50 posts
-
0
votes2
answers194
viewsA: Raising fraction to power
It follows a great solution: base = input('Digite a base: ') exp = int(input('Digite o expoente: ')) m_array = base.split("/") base = int(m_array[0])/int(m_array[1]) result = base**exp print('a base…
-
0
votes1
answer142
viewsA: Pass values from a Fragment to an Activity
You can use the class SharePreference to share the information for that purpose or use two other methods described below: Creating a Sharedpreferences SharedPreferences pref =…
-
3
votes1
answer110
viewsA: Fill items from a Dropdownbutton with a Json value
I don’t know if I fully understand what you’re up to, especially since I don’t understand what your _mySelection, if it is a function or what. But from what I understand you want to return the…
-
1
votes1
answer173
viewsA: How to close app when clicking a Dialog in Mainactivity?
The function below closes in a simple way, and even cleans the entire java machine dedicated to the application execution. However, you should call it from the main activity, otherwise Android can…
-
1
votes1
answer595
viewsA: How to change the status bar text color with Cupertinonavigationbar
Works perfectly: void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { // Apply color in status bar…
-
-4
votes1
answer84
viewsQ: How to download a program from a linux repository without installing it?
I wonder if it is possible, if yes, how to download a program from a linux repository without installing it. The reason is that almost every time I want to install software, I can use a command on…
-
0
votes3
answers1808
viewsA: When should I use "Return" or "print" in a function?
I chose to answer you in the simplest possible way by ignoring all the formalities: Although they look the same, they are totally different and are used in completely different contexts. The…
pythonanswered Edeson Bizerril 661 -
0
votes1
answer31
viewsA: use Handle in textView
Since no code has been placed for us to analyze, follow a generic model so you can quickly adapt your reality: import android.os.Bundle; import android.os.Handler; public class MinhaClasse extends…
-
0
votes1
answer459
viewsQ: How to create python module and make available for any application
I wish my python program could be put into the system in such a way that with a simple import it can be executed, for example: import meucodigo meucodigo.main() My code contains several files (own…
pythonasked Edeson Bizerril 661 -
0
votes2
answers309
viewsQ: Get python Documents directory automatically
I need to automatically get the address of the document folder of any Windows with Python. Currently in my script determined as shown in the variable main_folder, but whenever I change PC I have to…
pythonasked Edeson Bizerril 661 -
0
votes1
answer347
viewsQ: Attributeerror: 'Directores' Object has no attribute
I am trying to get a value of a very simple class, but I have a problem that I cannot solve. Follow the codes below: Main class: from directores.directores import Directores # A classe Directores…
-
0
votes1
answer93
viewsA: Counter (Transaction) in firebase fatal error
I managed to develop the solution, below: private DatabaseReference mDBAnunciantes = LibraryIO.getFirebaseRef().child("anunciantes").child("estatisticas"); private Integer currentValue; private…
-
0
votes1
answer93
viewsQ: Counter (Transaction) in firebase fatal error
Guys I’m trying to make an accountant, in fact I’ve used this idea to tell in firebase, which is a correct and safe way to make a counter for firebase. MutableData mData; //Contador +1 ao Firebase…
-
1
votes3
answers883
viewsA: Allow Select PDF only in JS
In full, we have the following answer to your case: <!DOCTYPE html> <html> <body> <h1>Selecione o arquivo PDF:</h1> <h3>Selecione o PDF:</h3> <form…
-
0
votes1
answer191
viewsA: Toolbar is not displayed in the editor
Colleague you have not implemented the Toolbar, follow how you should do: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout…
-
1
votes1
answer304
viewsA: Display FIREBASE image in a LISTVIEW
Colleague, with the link below you will understand how to create step-by-step, and in several ways, a Recycleview, which is the same Listview, but much more improved, optimized and simpler to…
-
1
votes1
answer114
viewsA: For - loop loop
The second part of your problem: if (i % 5 == 0){ for(int a = 0; a < i; a++){ if(a % 5 == 0){ System.out.println("O número " + a + "é multiplo de 5 e anterior a " + i); } } } Regarding prime…
javaanswered Edeson Bizerril 661 -
1
votes1
answer31
viewsA: Is there a problem with instantiating a fragment twice?
There is no problem, as long as each call has a new instance, which is certainly the case. I have an application that has a single fragment for several moments and never had any problem. Even it is…
androidanswered Edeson Bizerril 661 -
0
votes1
answer58
viewsA: Python3 Format print, to take bugs from symbols
Put this command in the first line of your code and it should work for everything to be utf-8: -*- coding: utf-8 -*- The pycharm IDE uses another similar command, but if you write this one it will…
python-3.xanswered Edeson Bizerril 661 -
0
votes0
answers90
viewsQ: Error when using Proguard the first time in an Android app
My Gradle is in the following: buildTypes { debug { shrinkResources false minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release {…
-
0
votes2
answers26
viewsA: Problem with sharing
I believe it is being cached, for my little experience, I believe that it depends on Android for Android, because I’ve seen some that only mark the last used. My app has almost the same code you…
androidanswered Edeson Bizerril 661 -
1
votes2
answers789
viewsA: Error installing application on mobile
This problem is quite recurrent. This always happens when there is a version of the app installed on the phone that differs from being debugged and I believe that, in your case, may be the name of…
-
-1
votes2
answers541
viewsA: Problem in recovering data from firebase
This problem can be solved in several ways. The one that I most use is the following: As I can’t control the asynchronous listener, so I try to turn it into synchronous, ie control it. I do exactly…
-
0
votes1
answer138
viewsA: Search in Firebase
Answering your question correctly would take me a long time, so I will be answering in order to help you with what you are aiming for. I usually work with firebase as standardized as possible and…
-
0
votes3
answers783
viewsA: How to input() stop after space instead of line break in Python3
It’s an extremely confusing question and by the little I understand you want to find a value " " the system stops, if it is not correct the question. Anyway it follows the solution to what I said:…
-
3
votes1
answer370
viewsA: Syntaxerror: invalid syntax for no apparent reason
The if and the else are without the two-point sign. Example: if(condição): # Código elif(condição): # Código else: # Código
python-2.7answered Edeson Bizerril 661 -
0
votes1
answer88
viewsQ: Send a message by Onesignal from Android
The code below serves to send a push message via Onesignal, when running in Netbeans everything works perfectly but when trying to run on android did not succeed. I’d like you to help me, so follow…
-
0
votes1
answer188
viewsA: Notice Push on Android with Onesignal - Action in the background
I managed to solve the problem and it is working perfectly, follow the solution found at the following address: Documentation follows my code: import android.support.v4.app.NotificationCompat;…
-
0
votes1
answer188
viewsQ: Notice Push on Android with Onesignal - Action in the background
I have in my android application the service Onesignal working properly, so far so good. I want to make some modifications to my Sharepreference (database) each time I receive a message. I managed…
-
0
votes2
answers139
viewsA: Set functions for equal values and values in ascending order - Python
I haven’t tried it, but I believe it’s quite simple and it should work: #Fazendo a ficha com nome sexo e idade registros = [] masculinos = [] idadesCrescente = [] def leitura_registros(): for x in…
-
7
votes6
answers12886
viewsA: Doubt about logical operators && e || in Java
The use of the operator && or the operator || will depend on your condition. The operator && will be used when all conditions must be NECESSARILY true, example: if(a && b…
-
2
votes3
answers5196
viewsA: How to set up a timer in Android Studio to perform tasks at constant intervals?
I strongly recommend using the class Handler because on android, any process a little time-consuming and that is not in a Thread will be considered a lock and will be terminated with a critical…
-
1
votes2
answers7328
viewsQ: Limiting the number of characters in a Python string
Guys, I have a Python script that during the processing of information is generating string with many characters and I need each string to create a folder with its "name". But don’t get caught in…
pythonasked Edeson Bizerril 661 -
3
votes1
answer1711
viewsA: How to show accents in python?
Try to put this at the beginning of your scheduled, on the first line: #encoding: utf-8
-
0
votes1
answer117
viewsA: Scope of variables
By logic and taking advantage of what you are trying to do, I believe the solution is as follows: inteiro valor = 15 programa { funcao inicio() { escreva("valor=", valor) } } This variable valor…
portugolanswered Edeson Bizerril 661 -
0
votes1
answer187
viewsA: Close a Dialog When you click the back button
By default the dialog should end with the back button of Android, what may be happening is that you are using the method builder.setCancelable(false); and it prevents the dialog from being closed by…
-
0
votes2
answers305
viewsA: Save data to an Activity when changing Activity
I believe that using Sharepreference is much easier. Create a class and have all the data saved whenever you leave, that is, save in the method onPause, search on, but if you need more details let…
-
2
votes2
answers256
viewsA: What tools should I use to create an android app
Design Hello, one of the best tips for you is to initially design your screens with the free software Gravit Design, as it will be able to create absolutely all the screens of your app, because…
-
1
votes2
answers313
viewsA: Status bar with three-color gradient in Android Studio
I’ve never tried but I believe you should create an xml gradient and apply it as background in your bar status, follow a gradient model with only two colors: <item…
-
3
votes1
answer144
viewsA: How to use the Strings file inside the code
To reference through java use the following flame: @Override public void onClick(View v) { Toast toast; switch (v.getId()){ case R.id.ce : toast = Toast.makeText(getApplicationContext(),…
-
1
votes4
answers365
viewsA: Repetition for calling variables
I don’t know if I fully understand, but here’s a possible answer to your problem: If you have a list, for example: lista = [f1,f2,f3,f4] You can use the list directly in for: for i in lista:…
-
0
votes2
answers1343
viewsQ: Is it possible to use firebase on computers?
I need to create an application for control of finances customized for the company I work and I wanted to know if it is possible through some mechanism to create a database in firebase to be used in…
-
0
votes2
answers885
viewsA: Set permissions for app at runtime
For versions of Android 6 or higher it is mandatory that dangerous permissions are requested at runtime, so it is important to know this. Permissions such as internet access and Wi-Fi configuration…
-
1
votes0
answers2543
viewsQ: Generate custom report with Python
someone has worked or seen someone develop custom python reports? For example, in Java we can easily create a report with iReport that features sample templates and new templates with drag-and-drop…
-
1
votes2
answers397
viewsA: Edittext Spacing Help
if (p instanceof LinearLayout.LayoutParams) { LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)p; if (_default) lp.setMargins(mc.oml, mc.omt, mc.omr, mc.omb); else lp.setMargins(mc.ml,…
-
0
votes1
answer542
viewsQ: Intellij IDEA Community and database usage
Guys, I’m thinking of using Intellij IDEA Community to develop in Java, but I saw that this version has no database tools. I saw it on the website but it wasn’t clear. Does anyone work with this…
-
1
votes1
answer477
viewsQ: Google Sigin problem when re-logging into Firebase
I have a little problem logging into Firebase using the Google Sigin. The point is that I am able to log in with this method, but when there is a problem after selecting some account (figure below)…
-
3
votes2
answers1981
viewsQ: How to subtract hours in java?
I am trying to days make the difference of hours in my application. The case is as follows: Based on the Current time and current minute, I want to compare another time I have in a string and I need…
-
1
votes2
answers467
viewsA: How to store and use a vector in Firebase on Android?
Based on Matheus' answer, it follows my functional result: I added a simple string to a Child in Firebase and used the following command to find this string and turn it into an array of the type…
-
1
votes2
answers467
viewsQ: How to store and use a vector in Firebase on Android?
I have a problem developing my app that I can’t fix and I can’t find anything that would help me. Such an app was running smoothly with data stored in variables, but when including Firebase I had…