Posts by Adliano Alves • 306 points
18 posts
-
1
votes1
answer1738
viewsA: Format a coin-style textfield
tries this for numbers, when you parse if the string is not a valid numeric format parse throw a Numberformatexception try { funcionario.salario =…
-
1
votes1
answer610
viewsA: Take a photo with the Front Camera without using obsolete Apis
Voce can use the camera via Intent , the code below runs in 4.1 and 6.0 , however in 6.0 You will have to add the permission in the run time (I haven’t had time to do it yet) but Oce can go in the…
-
1
votes2
answers64
viewsA: Check smartphone horizontally
I saw your comment and I know using the measures , this way that Carlos Bridi posted is very good , but if you see that using measures ai you can use this code below: public class MainActivity…
-
2
votes1
answer74
viewsA: Android Device Monitor
Note the Toll-tips from what I understood if Voce wants to take the file from your device and save on your computer Voce have to use the pull choose where Voce wants to save this file and if you…
-
3
votes3
answers4673
viewsA: Pass data between Fragments
Bundle only dates to another Fragment if the same has not passed through the attach. Fragment does not communicate directly with another Fragment , Fragment has to communicate with Activity and…
-
2
votes1
answer63
viewsA: How can I make my code with fewer lines?
that part here : String jogadores = JOptionPane.showInputDialog(null, "Selecione a quantidade de jogadores."); setLayout(new FlowLayout()); //configura o layout de frame if (null != jogadores) { if…
-
1
votes6
answers3996
viewsA: Check if Edittext is empty
"thread exiting with uncaught Exception" declare value1 and value2 global and use it here : try { valor1 = Double.parseDouble(edt1.getText().toString()); valor2 =…
-
2
votes2
answers3070
viewsA: How to leave the screen always on with the app open?
Before setContentView() use : getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); There is a better way that it would be an attribute in the.xml layout but I don’t remember at the…
androidanswered Adliano Alves 306 -
0
votes3
answers1544
viewsA: How to go to the next field( an Edittext) without having to press Next on android?
trial : public class MainActivity extends AppCompatActivity { public EditText edLetterOne,edLetterTwo; @Override protected void onCreate(Bundle b) { super.onCreate(b);…
androidanswered Adliano Alves 306 -
0
votes2
answers64
viewsA: How to store different ids for Edittexts with the same name?
trial : for (int j = 0, int x = 1; j < vet.length; j++, x += 2) { EditText nome = new EditText(this); nome.setId(x); EditText sobrenome = new EditText(this); sobrenome.setId(x+1); }…
androidanswered Adliano Alves 306 -
0
votes4
answers2422
viewsA: How to open a keyboard when you "focus" on an Edittext?
if Voce has only one Edittext in its Activity it is sufficient to use the following Attributes in its manifest.xml android:windowSoftInputMode="stateAlwaysVisible" where ? : <activity…
androidanswered Adliano Alves 306 -
0
votes3
answers1476
viewsA: How to know which Boot was clicked on my Listview?
1) create a method with View Argument. 2) use switch (or if) using view.getId() , this method returns the int id of the button that received the event (the click). 3) add the attribute…
-
0
votes1
answer1215
viewsA: "No Emulator images (avds) found" even after creating emulator images
to get faster right there speaks HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver by msg vc must be using Windows, if your CPU is compatible install the HAXM…
apache-cordovaanswered Adliano Alves 306 -
1
votes5
answers839
viewsA: How can I add a value to a Row in the comic without having to add variables?
I’d do a Stored Procedure in your mysql command (I think you are using mysql) the first line of the sql delimiter DELIMITER $$ CREATE PROCEDURE IF NOT EXISTS addSaldo(IN costumerName VARCHAR(255),…
-
1
votes1
answer718
viewsA: How to destroy a Session in java?
Try to use that: Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; i < cookies.length; i++) { cookies[i].setMaxAge(-1); // se -1 nao funcionar tente 0 nao lembro bem…
-
1
votes1
answer101
viewsA: Illegalargumentexception error when displaying data in the application
I think your mistake is here String sql = "CREATE TABLE "+tabela+"( " +id+" integer primary key autoincrement, " +livro+" text(40)" +")"; by which I noticed your id and a variable as this field…
-
0
votes1
answer88
viewsA: Create Jlabel under image
have several ways , if you want to do something simple use setLayout() if you want to have more control over your layout create Jpanel and add() later in your frame here you find the list of layouts…
-
0
votes1
answer154
viewsA: Function to catch mouse drag coordinates
a good mareira would be you create a class where you will have everything you want to save , type Point, Color, format , etc . type: public class MyPoints { Point pointPressed, pointReleased; // faz…
javaanswered Adliano Alves 306