Posts by Aline • 3,739 points
129 posts
-
0
votes1
answer318
viewsQ: Denied error when connecting spring boot to mysql
I’m trying to connect with mysql but only this error: Caused by: org.flywaydb.core.internal.Exception.Flywaysqlexception: Unable to obtain Connection from database: Access denied for user…
-
0
votes1
answer24
viewsA: How to restrict that some folders are displayed in the gallery? android
I followed that: https://stackoverflow.com/questions/6713850/android-how-to-hide-folder-from-appearing-in-the-gallery and it worked. created a.nomedia file and put it in my folder that I didn’t want…
-
1
votes1
answer24
viewsQ: How to restrict that some folders are displayed in the gallery? android
I know how to list all the gallery photos but I need the Download folder not to appear in the list. I know I can filter but I can’t make it work. I do not parameter in the query I must paste so that…
-
0
votes2
answers456
viewsQ: How to set a background color and borders for my button beyond the states pressed and not pressed on the button with?
I would like besides my button to have a lower edge more than had the button states pressed, not pressed would be another color... I am trying to do all this in my drawable xml to set a background…
-
1
votes2
answers108
viewsQ: Why don’t you instantiate the list so it doesn’t accumulate?
I have the following class: public class TesteLista { public static void main(String[] args) { List<String> dados; Teste1 t = new Teste1(); dados = t.getList(); System.out.println(dados); } }…
-
12
votes3
answers1357
viewsQ: Is it wrong to use multiple cases for the same action on the switch?
It’s wrong to do that with the switch? I programmed like this with him, it’s wrong? switch(estado){ case "AL": case "BA": case "CE": case "MA": case "PB": case "PE": case "PI": case "RN": case "SE":…
-
2
votes2
answers698
viewsQ: How to make Linearlayout stay at the bottom of the screen?
I’ve tried many things here to make my Linearlayout stand at the bottom of the screen but I can’t do that. I need to do this with Linear which has id= "underneath" Does anyone know? Follows my xml:…
-
2
votes2
answers370
viewsQ: How to Change Linear Layout Transparency
I have a login screen that has a LinearLayout blue background tranparente. How can I do this LinearLayout with id be translucent? <?xml version="1.0" encoding="utf-8"?> <LinearLayout…
-
0
votes1
answer141
viewsQ: How to cancel Edittext enter?
I wish the keyboard didn’t happen when the user touched enter. How can I do that?
-
1
votes1
answer42
viewsQ: How do I know when the user touched outside of Edittext?
I need to identify when this happens. I have two Edittexts, when the user type the time and minute and tap another Edittext example name, I need to appear a warning if the time is incorrect. I have…
-
0
votes1
answer89
viewsQ: How do I disable the third and fourth Edittext if the first is not filled in?
I have three Edittext and need to check if the first Edittext is empty and if the second Edittext is also empty. If Yes I must disable the third Edittext. How can I do that?
-
1
votes1
answer132
viewsQ: Display a value with the non-zero cents and using Float?
Is there any way to make the pennies not cut with float type? I am converting a value to be formatted with Decimalformat so that it looks like the pennies this way: Float numero =…
-
-2
votes3
answers37
viewsQ: Doubt about why it does not give nullpointexception
It’s a dumb doubt but why does this code work? public static void main(String[] args) throws ParseException { List<String> lista2 = teste(); System.out.println(lista2.toString()); } In this…
-
3
votes1
answer66
viewsQ: What’s the difference if I instantiate a class within the method or if I instantiate just once?
Instance of a class each time I call the method: public String formatar(int valorFormatar){ DecimalFormat df = new DecimalFormat("###,###,###"); return df.format(valorFormatar); } Now an example of…
-
1
votes1
answer74
viewsQ: Doubt about logic, ifs with multiple checks
I have a code where I need to verify that two entries are true. I’m doing like this: if (!estudante.getOutTotal.equals("0") && !estudante.getOutEmAtendimento.equals.("0")) { // Faz algo...…
-
4
votes1
answer37
viewsQ: I have a fragment that renders an xml but if there is no record I want it to render another page(xml)
I am new on android and do not know how to do it. Follow a small piece of my code. I will check if there are no records if the list is not empty. If it is empty I need it to render another page of…
-
0
votes1
answer83
viewsQ: Why is it when I do two operations with integer numbers and save the result in a double it gives me a 0.0 return?
Example: double teste = 673/5455 * 100; System.out.println(teste); It prints 0.0 and this is not the result of the account... why it happens?
-
0
votes0
answers211
viewsQ: How can I make Cardview dynamic-sized?
I got a little problem... I have several Cardsview and their size is static I would like to know how to make this size adaptable to what is on cardView. Because in a Cardview I have a list that…
-
2
votes2
answers1162
viewsQ: How to get back from a Fragment to an Activity?
I created an Activity of type Drawer Navigation and in the icons of this Activity has an action that takes me to a fragment. My problem is that I don’t know how to come back from a fragment to an…
-
-2
votes1
answer224
viewsQ: How to implement the method onBackPressed() in a class it inherits from Fragment, Causing it to return to the previous Fragment?
Segue um trecho de código para exemplificar meu problema: public class DashboardFragment extends Fragment{ ... } @Override public void onBackPressed(){ //Aqui volta para o Fragment anterior... }…
-
0
votes2
answers99
viewsA: Icons in actionbar do not appear
Solved my problem by putting on onCreate(): setHasOptionsMenu(true);
-
-1
votes2
answers99
viewsQ: Icons in actionbar do not appear
I have a Fragment and I’m putting these two methods in the class @Override public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) { menuInflater.inflate(R.menu.alerta, menu);…
-
1
votes2
answers832
viewsQ: Press the button of a screen that is a Fragment and go to another Fragment. How do you do?
I have a class like Fragment and would like when the user clicks the button to go to another screen that is Fragment.. how can I do this? public class AlertaFragment extends Fragment { @Override…
-
2
votes1
answer145
viewsQ: How do I display the Floatingactionbutton?
Could you help me? I’m trying to make the Floatingactionbutton appear on my screen but it doesn’t want to appear I don’t know what I do anymore...I’m a long time trying to solve this problem but I…
-
1
votes1
answer199
viewsQ: How do I get the listview style effect?
I have a layout and in it I want to display the data in this ListView but I need it to have a white background with no stripes and no click enabled when it’s touched. I can do it this way??…
-
1
votes1
answer162
viewsQ: I have a list and how do I display all the elements?
This method only returns me to the last position of the list, the others it does not show. How do I display all same? Agente agente = new Agente(); List<Agente> lista = getA(); for(Agente a:…
-
1
votes2
answers3503
viewsQ: How can I count fields that are NULL?
I’m using this query: I would like to know how to count these fields that have no records. Here returns 0. But I have some null records. What I do? SELECT DataFim, COUNT(DataFim) AS QTD FROM…
-
2
votes1
answer96
viewsQ: what does it mean to clear a Calendar variable?
I want to know when I should use clear() and why to use. SimpleDateFormat simpleDateFormart = new SimpleDateFormat("dd/MM/yyyy"); Date data1 = simpleDateFormart.parse("18/12/1986"); Date data2 =…
-
2
votes1
answer244
viewsQ: Could someone tell me what happens in this method?
I have a method that does some things that I would like to know what is...just explain me please please briefly? private static byte[] readFully(InputStream in) throws IOException {…
-
0
votes1
answer289
viewsQ: I want to use Cardview to make the screen more beautiful only cardView works similar to a listview?
And I want to take dynamic data to show on the screen. Dynamic data that will come from a webservice. So I need to use Recyclerview with Cardview Layout to make the data dynamic? How can I make my…
-
5
votes2
answers527
viewsQ: Is there a difference between the visibility of a view.GONE or false?
I would like to know which of these implementations is the correct one? tlb.setVisibility(View.GONE); or tlb.setVisibility(false); What’s the difference between them?…
-
2
votes1
answer2545
viewsQ: What’s the difference between a Toolbar and an action bar?
I’ve researched a lot about it and I haven’t found anything that could explain it. Is there a difference or is the same thing?
-
4
votes2
answers498
viewsQ: How can I easily make application location permission?
I found this tutorial https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en but I didn’t understand anything. I looked at this tutorial: //…
-
1
votes1
answer1242
viewsQ: How to leave the first character uppercase on the keyboard?
How to start keyboard with uppercase letter for the user to start writing without having to tap the arrow to make the letter uppercase? I used android:inputType="textCapCharacters" but it didn’t…
-
1
votes1
answer108
viewsQ: How do I send a message telling the user the start date is longer than the end date?
I spent all afternoon making this code but I couldn’t get it to work properly. What do I do to send a message to the user saying that the start time cannot be longer than the end time? xml: <?xml…
-
5
votes1
answer7176
viewsQ: I want to compare start date and end date. The start date always needs to be less than the end date. Compareto() an error came to me
When the final date is with the time of 00:00, it identifies that the initial date is greater than the final date only it is not, the initial date remains smaller. When I set the final date…
-
0
votes1
answer96
viewsQ: Where do I find logs like login and password stored in the xml that Sharedpreference does?
I wanted to find the file path because I want to confirm if my function encrypted this data.
-
2
votes3
answers818
viewsQ: How can I set the address as the street and neighborhood corresponding to latitude and longitude?
I have that code: protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(requestCode == MAPA_REQUEST_BAIRRO){ if(resultCode == RESULT_OK){ try { Place place =…
-
1
votes1
answer95
viewsQ: Alternative to obsolete methods onCreateDialog() and showDialog() from Activity?
I would like to know but the funny thing is that I ran here and it worked even saying that it is obsolete. What should I do? private Button botao; static final int DATE_DIALOG_ID = 0; @Override…
-
4
votes2
answers67
viewsQ: How to reverse series of denied conditions without affecting logic?
Could someone explain to me why this happens? My apk only works right if I put denial and do something: public class Main2Activity extends AppCompatActivity { private EditText nome, teste, cpf;…
-
-1
votes1
answer477
viewsQ: How to break (split) strings and put result into separate variables?
public class Teste30 { public static void main(String[] args) { // TODO Auto-generated method stub String teste = "Isso funciona mesmo, ok?"; String [] vetor = teste.split(" "); String aqui = null;…
-
0
votes0
answers41
viewsQ: In a Spinner type component how do I Seto it with a data coming from a webservice?
Am I doing it this way would be correct? The problem is that it is not working as expected follows code: Here I take the data that comes from a list and the other screen and save it in situation:…
-
1
votes2
answers758
viewsQ: Ask the user if he really wants to quit
I have the following code: public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.nav_camera) { // Handle the…
-
0
votes2
answers1229
viewsQ: How to make the actionBar back button work?
I’m not getting it to work. Help me. My manifest is like this: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"…
-
0
votes1
answer262
viewsQ: Alertdialog button does not appear
I’m trying to get the button okay appear. I want to do with AlertDialog. That stretch is within a second Trhead. Help me? activity.runOnUiThread(new Runnable() { @Override public void run() {…
-
1
votes2
answers69
viewsQ: How do you make it when the user touches the menu symbol and the message appears in Toast?
I have this method but it doesn’t work what I do? :( @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present.…
-
0
votes2
answers206
viewsQ: What is this for? requestWindowFeature(Window.FEATURE_NO_TITLE);
I was studying a webservice for android consume and I came across this:: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
3
votes1
answer70
viewsQ: How to handle C# data from a table that is bit-like in sql server?
In visual Studio will look like this: alerta.DataHoraCadastro = dr.Get(12); How do I do that?
-
-1
votes1
answer40
viewsQ: I’m finding it very complicated to fix the layout in xml
I want to make a simple menu. But it gets all crooked Why do I do? Someone gives me tips? I’m new to android. <?xml version="1.0" encoding="utf-8"?> <LinearLayout…
-
0
votes1
answer53
viewsQ: Why should I create a static method and not one that could instantiate the class and use this method?
I really don’t see any difference in these two methods uses. Could someone be more specific with me and inform me about this?