Posts by ramaral • 44,197 points
1,060 posts
-
3
votes1
answer134
viewsA: Error in the Arrayadapter
The builder of Arrayadapter expects to be passed an object of the type ArrayList<> but you’re passing an object like GoogleApiClient. Alter adapterClientes = new ArrayAdapter<>(this,…
-
1
votes3
answers664
viewsA: Request within a defined time interval
There are several ways to do this, before choosing one, it is necessary to know what each one offers us and choose the one that best suits our needs. The main advantage of Alarm is that it operates…
-
2
votes1
answer88
viewsA: Doubt with scenes (Scene)
You must, after the transition, use again findViewById(R.id.edit_text); if (start) { TransitionManager.go(scene2, anticipateTransition); editText = (EditText) findViewById(R.id.edit_text); start =…
-
1
votes1
answer54
viewsA: How to define a boolean value of a Radiogroup
The Radiogroup manages a set of Radiobutton where, when one is selected, the selected. It is possible to select any of the Radiobutton within the Radiogroup in two ways: through the R.id button…
-
0
votes1
answer124
viewsA: publishProgress only updates the Progress Dialog at the end of theInBackgorund
The method getString() of Getjsonarray is asynchronous. When the method onSuccess() is called, already the method onPostExecute() of Asynctask was executed. No sense running an asynchronous…
-
7
votes4
answers549
viewsA: Problem with polymorphism
Putting aside any opinion on what is the best way to implement the converter, this would be the implementation of the way it suggests in the question. Interface that each "temperature unit" should…
-
4
votes1
answer479
viewsA: How does the allowBackup tag work?
The allowBackup determines whether or not the application data can be saved/restored by the backup and restore infrastructure. If the application runs on an Android device 6 or higher, nothing needs…
-
2
votes1
answer357
viewsA: Doubt in Send SMS + GPS coordinates
So you can access the values of the variables latitudeand logitude any part(method) of the Activity class must declare them as fields. Do so: String latitude; String longitude; @Override public void…
-
4
votes1
answer291
viewsA: Different source code for release/debug version
Android Studio, when creating a module, automatically creates the build types debug and release. However, it only creates the source set main/. So you can put code to be used as Build…
-
2
votes1
answer286
viewsA: Create a Marker at the current Maps position with Fragment
You can use the setMyLocationEnabled() in the method onMapReady() There’s a reference to the map. Do so: mMapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(GoogleMap…
-
5
votes2
answers355
views -
2
votes1
answer47
viewsA: On android which class corresponds to javafx Image class
The class used on Android to work with images whose format represents a map of bits is Bitmap. Having the array of bytes use the method decodeByteArray() class Bitmapfactory to decode the array in a…
-
3
votes3
answers4692
viewsA: Unable to start Activity Componentinfo
You are converting an empty string("") in a whole. a = Integer.parseInt(edtA.getText().toString()); This is because nothing has yet been introduced into Edittext. I suggest you do the following:…
-
4
votes1
answer564
viewsA: When should I use mipmaps?
The difference between the folder drawable and the mipmap is that when the application is installed on a device with a certain screen density, the Resources the other densities are discarded from…
-
0
votes1
answer110
viewsA: Pass Activity coordinates to Mapsfragment
Why not get the location on Mapsfragment? Pass that code Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (location != null) { lat =…
-
5
votes1
answer605
viewsA: Why is it recommended to use "sp" instead of "dp" in text sizes?
The recommendation is based on the assumption that the user when he changes the text size in the accessibility definitions expects it to be reflected in all texts of all applications. For this to…
-
1
votes1
answer205
viewsA: Set photo size taken by phone camera
You can decrease the dimensions of an image using the Bitmapfactory.Options passed to Bitmapfactory.decodeByteArray(). Write an auxiliary method to calculate the value of…
-
1
votes1
answer90
viewsA: Listview and Imagebutton selector does not work
The order in which states are declared has importance in the way they are applied, which is not always obvious. The best way to avoid these situations is to declare as few states as possible and do…
-
0
votes2
answers76
viewsA: App stopping when using Location API
The method blockingConnect() may only be used in a thread other than the UI thread. You can use it for example in the method onExecute() duma Asynctask. However the recommended is to use the method…
java android google-maps-android-api-2 google-api-client google-location-apianswered ramaral 44,197 -
5
votes1
answer177
viewsA: How to remove a Custom Dialog title?
In the archive /res/values/styles.xml declare a style added these lines: <style name="CustomDialogTheme" parent="@android:style/Theme.Dialog"> <item…
-
3
votes2
answers400
viewsA: Slow search ignoring accents
For each "title" you check you are always removing the accents from the text to compare. Remove only the accents from the text once and use it in each comparison with the "title" Use a class to make…
-
4
votes1
answer74
viewsA: Problems with Asynctask
The use of Asynctask, in this case, makes no sense, Jsonarrayrequest is already asynchronous. The method onPostExecute() is to be called before the onResponse() because the task performed on…
-
2
votes2
answers234
viewsA: I need to click the button twice to get the value
The value of statusdareserva is obtained in the method ProcuraReserva() asynchronously. Notice you had to create a Valueeventlistener to receive it. That is, the execution comes to the line return…
-
0
votes1
answer53
viewsA: Error trying to fetch Sqlite ID via Spinner
Your Adapter generate objects of the type String, he is declared as ArrayAdapter<String>. So when you do Livros livros = (Livros) parent.getSelectedItem(); is trying to convert an object of…
-
4
votes2
answers129
viewsA: Silent applications
The error states that this permission can only be obtained by system applications. For this to happen the application will have to exist in the "Android ROM" and be signed with it key, or else, in a…
-
5
votes3
answers172
viewsA: Blur effect on image
Use the class Scriptintrinsicblur Android to create the effect of Blur: Example of use, adapted from this question soen: @SuppressLint("NewApi") private Bitmap blurRenderScript(Bitmap smallBitmap,…
-
1
votes1
answer334
viewsA: Countdown counter with alarm
Alarmmanager "not made" for this type of processing. The very documentation, anticipating possible misuse, states: The Alarm Manager is intended for cases Where you want to have your application…
-
5
votes3
answers525
viewsA: Standardization of "String Resources" nomenclature
As far as I know there is no standardization indicated by google. However, you can find some "best practices" scattered in the documentation: Icon Names - Icon Design Guidelines, design tips. Folder…
-
2
votes1
answer110
viewsA: Sqlite check if data already exists
Instead of using resultado = db.insertOrThrow("PROFESSOR", null, valores); use resultado = db.repalace("PROFESSOR", null, valores); replace create a new registration or update an existing one with…
-
2
votes2
answers275
viewsA: Return values using Dialog’s
The Dialog is presented asynchronously, its result (function of the button chosen to close it) can only be obtained using a callback: Declare a interface: public interface DialogResultListener{ void…
-
6
votes4
answers6012
viewsA: How to increase memory of Android Studio IDE?
It is not advisable to edit any file in the Android Studio installation folder, because any change will be lost when there is an update of the IDE. The correct way is for the changed…
-
12
votes3
answers3385
viewsA: What are asynchronous processing and synchronous processing?
Asynchronous processing refers to processes that do not depend on the outcome of others, and can therefore occur simultaneously/separately. They run into Threads different. In contrast, synchronous…
-
1
votes1
answer81
viewsA: Browser does not reload last page
Save the URL of the page that was being viewed at the time the application went into the background. Can use the Sharedpreferences for that reason. Write two methods, one to save and one to read:…
-
1
votes1
answer414
viewsA: Using Broadcast Receiver with Downloadmanager
The Broadcastreceiver is being recorded in the method download(). Each time the method download() is called the Broadcastreceiver is registered. When the download finish the Broadcastreceiver will…
-
2
votes1
answer142
viewsA: How to place a Readonly column?
The estate Gridcolumn.Readonly is read-only. To specify whether a column is "editable" or you do not have to do so via property Gridcolumn.Optionscolumn thus:…
-
6
votes2
answers2002
viewsA: What versions of the Android SDK should I have installed at least?
Which of them are "extremely" indispensable so I can build Android App on my machine. The versions you need on your machine are: The latest version. You should always compile the application using…
-
2
votes2
answers368
viewsA: Change the Foreground of certain items in a Listbox, via Style, using a Converter?
EDIT The solution is to get a way to get the Path representing the item being rendered. Contrary to what I said this is possible. Simply do not indicate any Path on the tag <Binding> or use…
-
2
votes1
answer247
viewsA: I add items to Arraylist but when I use it it is empty
Note that it is not the method setArrayMedico() who fills in the list but the method onResponse(), class Jsonarrayrequest. Put another way: when the method setArrayMedico() is called it returns…
-
5
votes4
answers2661
viewsA: When creating folder inside the folder /res it is not visible in the left panel
The folders of an Android application follow a well-defined folder structure and names. In sight "Android" does not fully reflect the hierarchy of existing folders in the project, only the "type"…
-
2
votes2
answers94
viewsA: Multidimensional Json for Object in C#
You walked right by. Only needs the classes Class1 and Dateofbirth. What is that json represents a list of objects that can be represented by Class1, so the class is not needed Rootobject…
-
0
votes1
answer47
viewsA: Fragment being used by two different activties
When a Fragment needs to access the Activity, he must force the Activity to implement an interface that defines these methods. Thus the cast can be made for the interface and not for an…
-
4
votes2
answers992
viewsA: Is it possible to pass a method as a parameter to run on a thread?
You need to pass an object from a class that implements the interface Runnable. Declare a class that implements Runnable for each of the tasks it wishes to perform: public class Tarefa1 implements…
-
3
votes1
answer213
viewsA: Do you have a problem using 2 Handler.postDelay() at the same time?
It will depend on what methods run() do. Remember that the method run() will be executed in thread where the Handler, in this case at Uithread. Also bear in mind that arguments being passed to…
-
1
votes1
answer885
viewsA: Change Fragment components through an Activity
Each Fragment shall be responsible for managing/handling the content of its views. If the need for this change arises outside it, make available public methods that can be called from outside. For…
-
0
votes1
answer42
viewsA: Connection problem with Database
Error due to lack of permissions. They have to be declared in the file Androidmanifest.xml within the tag <manifest>, but you’re putting them inside the tag <application>. Change the…
-
3
votes1
answer628
viewsA: How to prevent a new instance of Activity from being created every Intent
This set of flags only does what you want if the launchMode of Activity for singleTop. In the archive Androidmanifest.xml, in that statement Activity, place: android:launchMode="singleTop" To…
-
0
votes1
answer260
viewsA: How to move textures using libGdx?
Add an attribute of the type Vector2 to class Mygdxgame to represent the position of the texture In the method create() create an instance containing your initial position: private Vector2…
-
0
votes2
answers332
viewsA: How to show a call activity when the device is locked and turned off
I think what you are looking for is one of the new features introduced by Lollipop(API21) in the notification system. Making use of the new property visibility, class Notification, it is possible to…
-
6
votes1
answer157
viewsA: Why is it not possible to capture exceptions triggered by async void?
It is not captured because the method calcularPrecos() returns nothing(void). For the exception to be propagated it is necessary that it returns Task or Task<T>. When an exception is launched…
-
1
votes2
answers177
viewsA: Error using Radiobutton gettext() method
You are trying to access a method on a null object (Radiobutton Rb). You can solve this or implement the method calcular() otherwise. The value returned by the method rg.getCheckedRadioButtonId() is…