Posts by Pedro Gouveia • 505 points
24 posts
-
0
votes1
answer47
viewsQ: Problem with javascript function uses class
So I have a function in javascript that changes the class of an object and then later I try to look for that object in another function with the new class , but that doesn’t happen and gives me a…
-
-2
votes1
answer42
viewsQ: Not deleting from the Database the data I want
I have this code that supposedly erases the date I put in the method from Database. But it’s not deleting from Database and I don’t understand why. Here is the information : public void…
-
0
votes1
answer30
viewsQ: Two spinners that cannot have the same selected value
Hello, I have a code that has two spinners and that if we select an option in one spinner in the other that option ceases to exist , what I did was the following : Whenever you click on the spinner…
-
1
votes1
answer198
viewsQ: How to resolve Sqlite auto increment gap?
I have a code that erases one Row whole of a database, but there is a problem because I get a hole getting an ID without data (what I deleted) for this being autoincrement, does not delete the ID…
-
0
votes1
answer26
viewsQ: Date formatter not working
I have a code that supposedly goes to format dd-mm-yyyy or for example 02-10-2017 but my problem is that this code instead of passing to 02-10-2017 is passing to 2-10-2017. Code : dt = 2 + "-" + 10…
-
3
votes1
answer442
viewsQ: Convert java.util.date to java.sql.Date
With this line of code I can get through java.util.Date for java.sql.Date? java.sql.Date sqlDate = java.sql.Date.valueOf(String.valueOf(date)); Taking into account that date this format : Sat Jul 01…
-
0
votes1
answer79
viewsQ: Permanent service in background
How to run a permanent service in the background. For example I want my app to run this method over and over again : public void addToCalendar(){ myDB = CustomApplication.getDatabaseHelper();…
-
1
votes0
answers30
viewsQ: Problem accessing SQL database without error
I have a code that uses SQL , and in this database , I have a column of dates, then I have a code that what it does is return the maxID (number of Rows, ie number of dates) and I have another code…
-
-3
votes1
answer76
viewsQ: Object null, I don’t understand why
I have this myDB object which is an object of the Databasehelper class, but when I try to invoke a method of that class it says that that object is null. Class where this object: public class…
-
0
votes1
answer29
viewsQ: Remove values for SQL file not working
I have this code, which takes Strings and puts them in a Database, but the problem is that it is creating Database but I don’t know why , it is not inserting the values in it. Below I leave the xml…
-
0
votes1
answer266
viewsQ: How do I stop Keyboard from messing with my layout?
How do I stop the button from moving when editText pulls the Keyboard? Thanks in advance. xml of Bhutan: <Button android:id="@+id/hora_picker" android:layout_width="300dp"…
-
3
votes2
answers4919
viewsQ: How to change the color of the Statusbar?
How do I change the color of this part of the app? I wanted to put everything in the same green color as this one below.…
-
2
votes1
answer47
viewsQ: Error using date type on android
I have this code: String dt = "2017-01-04"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); try { sdf.parse(dt); } catch (ParseException e) { e.printStackTrace(); } But when I use dt , in…
-
0
votes1
answer175
viewsQ: How to get jsoup to pass only specific parts of the site?
How do I make sure he only passes the €1.25 part to String? https://www.pingodoce.pt/produtos/tab-choc-negro-nestle-100g/…
-
0
votes1
answer19
viewsQ: Alertdialog when there is an exception
Good afternoon, I would like to know how to make a Alertdialog to be shown to the user when there is an exception , on android.
-
1
votes2
answers64
viewsQ: I don’t understand why the app closes
package com.pedrogouveia.teste1; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import…
-
-2
votes1
answer109
viewsQ: Why does the program close when I click the button?
Could someone tell me why the program closes after clicking the button? import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import…
-
-2
votes1
answer54
viewsQ: What’s the bug in the program?
Give me one mistake R appears in red. public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
1
votes2
answers6645
viewsQ: What is the function of wrap_content?
RelativeLayout onCreateLayout = new RelativeLayout(this); onCreateLayout.setBackgroundColor(Color.CYAN); RelativeLayout.LayoutParams ClickMeParms = new RelativeLayout.LayoutParams (…
-
3
votes1
answer7071
viewsQ: Why is the error "This view is not constrained ..." in Constraintlayout?
What is the reason for this mistake? This view is not constrained, it only has designtime positions, so it will jump to (0,0) unless you add constraints XML <?xml version="1.0"…
-
2
votes2
answers83
viewsQ: I don’t understand why it doesn’t work
I have a problem here, I don’t know why it doesn’t print anything. There are no compilation errors, but it doesn’t work. Class Students import java.io.PrintStream; public class Alunos { private…
javaasked Pedro Gouveia 505 -
15
votes3
answers2048
viewsQ: What is the function of the toString() method?
What is the function of toString() in Java? Why do we do System.out.println(compObjeto) and in the main() (assuming there is an object for the class comp called compObjeto), he does print of…
-
4
votes1
answer84
viewsQ: this inside a builder, what does it do?
good , can anyone tell me what this does ? public Tempo (){ this(0,0,0); } public Tempo (int h){ this(h,0,0); } public Tempo ( int h,int m){ this (h,m,0); } public Tempo (int h,int m , int s){…
javaasked Pedro Gouveia 505 -
0
votes2
answers135
viewsQ: Because the System.out.print.ln of this if is not played
Can someone tell me why my code doesn’t run the System.out.println(""); end if the if returns true . public static void tabelear (int tabela[][]){ for(int linha=0;linha < tabela.length; linha++){…
javaasked Pedro Gouveia 505