Posts by Emerson Barcellos • 954 points
68 posts
-
1
votes1
answer1423
viewsQ: How to undo 'Discart All Changes' from Visual Studio Code
In Visual Studio Code, the "Sourse Control: GIT tab" in "Discart All Changes" deleted the changes made and some files I created. There is a way to reverse this and recover the deleted files?
-
0
votes2
answers1102
viewsA: onPress does not call method in React Native
I decided after much research. That stretch: renderItem({ item }) {...} I switched to: renderItem = ({ item }) => {...} And now it works, I hope it helps someone ;-)…
react-nativeanswered Emerson Barcellos 954 -
0
votes2
answers1102
viewsQ: onPress does not call method in React Native
I have a TouchableOpacity that when touching does not call the method alert() in React Native, follow my code: var data = []; export default class VerOs extends React.Component { constructor(props)…
react-nativeasked Emerson Barcellos 954 -
1
votes0
answers103
viewsQ: java.lang.Illegalstateexception in Broadcastreceiver
I’m getting the following error on the console of my android app, this error shows the warning that the App stopped even not using it: Caused by: java.lang.IllegalStateException: at…
-
0
votes2
answers253
viewsQ: Is it possible to generate an executable in Android Studio?
Hello, I want to run my Android application on PC (Windows) without emulator, so it is possible to install with . exe, this is possible?
-
0
votes0
answers32
viewsQ: How to use 2 databases using Room Sqlite?
Hello. Is it possible to use multiple DB using Sqlite Room? In my case I need to use 2 DB if it is possible to switch from DB1 to DB2 dynamically?
-
2
votes1
answer112
viewsQ: How to make a method wait for the java server response using Retrofit2?
Hello friends I have the following method that requests to the server: public MetaDataR metodo1(final String m) { Call<MetaDataR> call2 = new RetrofitConfig().getMetasService().getMetas(m);…
-
1
votes1
answer11
viewsQ: How to use the AS operator with the Library Room?
I’m not getting the variable total, how do I do? @Query("SELECT SUM(item_valor) AS total FROM Itens WHERE total =>:data") Itens getMes(String data); The IDE warns syntax error in the full…
-
1
votes1
answer60
viewsQ: How to treat json in java
I’m trying to treat the following json: [{"code":"ARS","codein":"BRL","name":"Peso Argentino…
-
0
votes0
answers25
viewsQ: What are the risks in using Singleton in java
Hello, What are the risks of error when using the Singleton practice in java? I am using the following: private Os mInstance = null; private int numeroOs, updateServer; Context context; public…
-
0
votes1
answer786
viewsQ: How to get the Android device IP to be used in Socket() in java?
I’m trying to implement a point-to-point communication (device to device) and I need to get the real IP of the server device to then insert it into the client but I can’t. I’m using: ServerSocket…
-
1
votes1
answer430
viewsQ: Doubt in the use of Socket in java on android
I want to implement data transmission via Socket, I’m trying to implement Socket.io but I don’t understand how it works. I want to communicate between two android devices. I know you have the server…
-
0
votes1
answer58
viewsA: Query is repeating results - Sqlite
I solved the problem using the INSTINCT clause cursor = db.Select(DataBaseHandler.TABLE_OS + " LEFT JOIN " + DataBaseHandler.TABLE_SITUACAO + " ON " + DataBaseHandler.TABLE_SITUACAO + "." +…
-
0
votes1
answer47
viewsQ: Error closing Intent.ACTION_VIEW
I preview an image with Intent.ACTION_VIEW and when closing the following error occurs, I’m guessing it is in Mainactivity.class: E/AndroidRuntime: FATAL EXCEPTION: main Process:…
-
0
votes1
answer58
viewsQ: Query is repeating results - Sqlite
I’m making a query in my bd Sqlite, but is returning me some repeated results can not find the error. cursor = db.Select(DataBaseHandler.TABLE_OS + " LEFT JOIN " + DataBaseHandler.TABLE_SITUACAO + "…
-
1
votes1
answer44
viewsQ: Why does the connection pool close before displaying Sqlite data?
I am trying to display BD data in a Recycleview but get the following error: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.emerson.drawer, PID: 8316 java.lang.IllegalStateException:…
-
0
votes1
answer36
viewsQ: How to upload BD backup to the server using Okhttp?
How to upload the . db file (Sqlite backup), from the android device to a server using the Okhttp, java and PHP library?
-
1
votes0
answers45
viewsQ: Detect point on screen with device camera
Does anyone know any library or practice to detect a point in the image captured with the device camera? Ex. a white paper with a black dot, then the camera detects this point and gives the…
-
1
votes1
answer211
viewsQ: What is the best practice for instantiating a class in Java?
Aiming at performance, how should I instantiate an object (ex a Databasehandler) to be used in Fragments. I must instantiate them in Activity and pass via constructor method to the Fragments or…
-
0
votes1
answer78
viewsQ: android:layout_height="fill_parent" from Viewpager does not work
I have a ViewPage that does not work the android:layout_height="fill_parent", shows nothing on the screen, but if I determine an ex value: android:layout_height="500dp" the determined height…
-
2
votes2
answers4863
viewsQ: How to create a method with optional parameters in pure Java?
How I create a method that does not need to enter all parameters? Ex. There is a method that asks for 5 parameters. But I intend to use only 2.
-
3
votes1
answer84
viewsQ: How to rescue a variable from an Actor in Libgdx?
I have the following Actor: public class Carta extends Actor { Sprite sprite; public static int val, pos, peso; Texture texture; public Carta(int valor, int posicao) { val = valor; pos = posicao;…
-
1
votes1
answer378
viewsQ: How to view images with a proportional screen size with libgdx?
How do I display my game images in the size proportional to the device screen size, so that if an image is 1/3 wide of the screen on a 480x800 screen it should also be 1/3 wide on the 320x480 or…
-
2
votes1
answer81
viewsQ: Java function equivalent to the c++ map()
There is a function for java, equivalent to map() of c++? Basically it calculates the ratio between the values "minimum" and "maximum".…
-
1
votes1
answer150
viewsQ: How to add Actor on a Screen with Libgdx?
I’m not able to add actors (Actor) on a screen.I want to show an actor in the "Screenmenu" and nothing happens (the actor does not appear), follows me code: Mainclass.java. public class MainClass…
-
0
votes0
answers49
viewsQ: How to Redeem the Position of a Sprite with Libgdx
I am unable to rescue the position of a Prite. I want to rescue the position of only one Prite as I do? public class Cubos extends Actor { Sprite azul, verde, vermelho, amarelo, cinza; public…
-
3
votes1
answer33
viewsQ: How to rescue Edittext values created via script?
I have the following code that creates 4 Edittext in Layout: LinearLayout myLayout = (LinearLayout) findViewById(R.id.formulario); ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(…
-
0
votes0
answers521
viewsQ: How to Capture Device Microphone Sound
How to capture the device’s microphone sound. Better specifying. I only need the volume of the captured sound. The idea is to call a method to a given volume. It is possible?
-
0
votes1
answer38
viewsQ: Como definir a categoria de um app no android
How I define the category of my Ex app. media, tools, social... It would be in manifest.xml or playStore?
-
2
votes1
answer57
viewsQ: Onmouseup() method does not work in unity4
Hello! I’m new to Unity and I can’t make the Onmouseup() method work using UnityEngine; using System.Collections; public class touch : MonoBehaviour { void OnMouseUp() { Debug.Log("Drag ended!"); }}…
-
0
votes1
answer4184
viewsQ: How to get gps coordinates in java on android
What is the best way to get latitude and longitude on android. Ex. after the request (tap the button) the user waits for the gps to get the coordinates and after that displays them for the same.…
-
0
votes1
answer77
viewsQ: Error when terminating a java service on android
Hello! I am in error when closing the service of my application: 03-13 13:34:13.572: E/test(9039): Exception 03-13 13:34:13.582: E/AndroidRuntime(9039): FATAL EXCEPTION: main 03-13 13:34:13.582:…
-
1
votes1
answer969
viewsQ: Prevent the service from being closed
Hello, I have an android app that tracks gps signal, works normal but every time it gets in the background it closes alone. I already researched on the subject and saw that the android controls the…
-
2
votes0
answers116
viewsQ: Error terminating the java android service
I have a service running in the background that ends after a while after closing the app. I don’t want the service to end when closing the app Service: public class GpsService extends Service {…
-
0
votes1
answer97
viewsQ: How to use setText from a service running in java?
I have a service running a stopwatch that loops from one in a second, how to set the text in the open Activity? I’m using: //tempo new Thread(new Runnable() { @Override public void run(){ int…
-
3
votes2
answers1106
viewsQ: How to open an Activity from a java notification on android?
How to open an Activity by clicking on the notification. The detail is that I want it to reopen again even if it is open in order to update the data of it. I’m using: int icon =…
-
0
votes0
answers52
viewsQ: How to use "setViewBinder" in my Adapter for Listview
How do I use setViewBinder in my Adapter? In Simplecursoradapter I can: SimpleCursorAdapter adapter = new SimpleCursorAdapter(getActivity().getBaseContext(), R.layout.lista_chamados, cursor, from,…
-
2
votes1
answer1966
viewsQ: Why is my app not compatible with some devices on Google play?
I posted an app on google play, but unfortunately it’s not available for some of my devices. I am very confused, because in the development with Eclipse, I used the same devices for testing and they…
-
6
votes1
answer1925
viewsQ: How to request a trial in the java android app?
What is the best way to request an android app review? Ex. if the user chooses to rate it is directed to make a review of the app in google play.
-
8
votes1
answer3619
viewsQ: Get the previous URL with javascript
How do I get the previous URL of the current javascript page?
javascriptasked Emerson Barcellos 954 -
0
votes1
answer926
viewsQ: How to select a particular java listview line
How do I get the line id of a listview? The idea is this: before picking up the selected line, I’ll work with all the lines I’m trying. aList = new ArrayList<HashMap<String,String>>();…
-
1
votes1
answer59
viewsQ: How to delete a record without affecting the query?
I have two tables PRODUCT and CUSTOMERS. I am using Inner Join to link them in my consultations. I call the product and it displays the product, picks up the customer from the CUSTOMERS table and…
-
2
votes1
answer338
viewsQ: How to handle JSON coming from PHP with Javascript
I have the following json coming from the server: {"product":[{"descricao":"Xis…
-
0
votes1
answer130
viewsQ: How to send Activity values to webview Cordova?
How do I send Activity data and redeem in Webview with javascript from Cordova/Phonegap index.html
-
2
votes1
answer174
viewsQ: Error while displaying web images in android java
I’m trying to display images from the web in a ListView, but they appear out of order, on the wrong lines and change position with each update of Activity. Activity: public class…
-
1
votes1
answer364
viewsA: Problem with android/java camera
That question is solved! I disabled "Developer Options" in the settings of android 4.4.2 and it worked fine. Why error; do not know.
-
0
votes1
answer364
viewsQ: Problem with android/java camera
When opening the Camera or trying to get photo from the album the Internet that calls these functions ends, I call with: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File f = new…
-
1
votes1
answer375
viewsQ: Httpresponse java
how to handle the server’s json response? HttpResponse responsePOST = client.execute(post); String responseBody = EntityUtils.toString(responsePOST.getEntity()); String "responseBody" comes from php…
-
3
votes3
answers2485
viewsQ: How to insert res/string string in the String[]{} array;
I’m trying to put my Strings in an array to use on Adapter and I can’t. I’m doing like this: String cores[] = String[]{getString(R.string.cor1), getString(R.string.cor1)}; but it’s certainly not the…
-
0
votes0
answers25
viewsQ: How to create an Activity for a single?
How do I rescue the sqlite data and send it to the xml single? My Sqliteopenhelper: // Getting single Contact getSingle(int id) { SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor =…