Posts by Leonardo Figueiredo • 517 points
57 posts
-
1
votes2
answers170
viewsA: How to open Waze and navigate by address
If you build using iOS SDK 9.0 and newer versions, you need to add the following code to your app’s Info.plist file to include Waze: <key>LSApplicationQueriesSchemes</key> <array>…
-
0
votes1
answer56
viewsA: Pause running on an Android Service
Whoa, that’s all right!? Maybe the CountDownTimer may help you. new CountDownTimer(30000, 1000) { public void onTick(long millisUntilFinished) { mTextField.setText("seconds remaining: " +…
-
-1
votes2
answers387
viewsA: Pass textview value to another screen and convert to double again?
Whoa, blah, blah! Since you had doubts about where and when to retrieve the values in your Activity A, I posted the full code. In his Activity A: public class MainActivity extends AppCompatActivity…
android-studioanswered Leonardo Figueiredo 517 -
0
votes1
answer453
viewsA: How to pass double type variable through Bundle class?
Whoa, blah, blah! Since you had doubts about where and when to retrieve the values in your Activity A, I posted the full code. In his Activity A: public class MainActivity extends AppCompatActivity…
-
1
votes2
answers673
viewsA: App name does not appear in emulator equal appears when I’m fiddling with code
Whoa, that’s all right!? Your question is very clear, but if you want to rename the application itself, it will be in your AndroidManifest.xml on the tag application, where android:label will define…
-
1
votes1
answer136
viewsA: Problems running android studio app on mobile
Whoa, that’s all right!? Make sure the USB debugging on your Android phone is enabled. USB debugging is meant to connect and share information between a smartphone and a computer. How to enable…
-
2
votes3
answers769
viewsA: Table button to update the row
Whoa, whoa, whoa, whoa? Create the delete function to receive the parameter you want to delete: function excluir(matricula){ // execute sua ação com o parametro matricula por ex: (123)…
-
0
votes2
answers880
viewsA: Update only 1 item within firebase’s
Whoa, that’s all right!? there is no need for you to change everyone, you can just give a setValue() only in the attribute you want to change. firebaseSenha =…
-
3
votes1
answer259
viewsA: How to create a selector to choose between Camera, Gallery and Photos in Android Studio?
Whoa, that’s all right!? Follow a code that does exactly what you need. When you click the button call the method below. public Intent getPickImageChooserIntent() { // Determine Uri of camera image…
-
0
votes1
answer152
viewsA: Error opening dialog with recyclerview, when adding click on list item
Whoa, that’s all right!? Follows a simple and objective way to implement the code you are in need of: My Adapter, where RacaClickListener is my interface, I declare it and sign the click method.…
androidanswered Leonardo Figueiredo 517 -
0
votes2
answers228
viewsA: How to pass a search parameter in the retrofit with Kotlin?
Good afternoon, blza!? In retrofit version 2 the data encoded by form is sent when @FormUrlEncoded. Each key value pair is annotated with @Fiel of the name and the object providing the value. Make…
-
1
votes2
answers670
viewsA: How to hide the background of images in the android studio app?
Whoa, that’s all right!? To upload images, use some library to upload, recommend the Glide, but it also has the Picasso If you want to use the app offline later, Glide can save the image cache, and…
-
0
votes2
answers426
viewsA: Save photo via URL to database
Whoa, that’s all right!? Facebook already does the image hosting work, what I recommend is that you save only the URL of the same, recovering in the following format: mUser.getPhotoUrl().toString()…
-
0
votes1
answer184
viewsA: Remove value quotes in Jsonobject on Android
Create a model class to receive the data, for Json, I recommend using the Gson (google, she is amazing): Gson mGson = new Gson(); DadosModel mDados = new DadosModel(); mDados =…
-
0
votes1
answer32
viewsA: Link in a Nsattributedstring
Would it be an option to use a Text View? will do the same effect, and in it it is possible to mark the Data Detectors textview on your storyboard for identifying links, dates, phones, etc...…
swiftanswered Leonardo Figueiredo 517 -
1
votes1
answer141
viewsA: Error while receiving json from Android Studio objects
Note that in the error it is telling you where the problem is, an Object is expected, but it is receiving an array in json. Do it this way: Gson mGson = new Gson(); mDocumento =…
-
0
votes1
answer95
viewsA: output.json and app-relase.apk in Android Studio and the error while installing
Android Studio 3.0+ is responsible for this file. You don’t have to worry about the output.json, it only brings information about the generated APK. Take a good look: For older versions, what…
-
0
votes2
answers40
viewsA: Error trying to run firebase forgot-password
whenever necessary, in your onCreate() instate your auth: auth = FirebaseAuth.getInstance();
-
0
votes2
answers49
viewsA: Change the color of a list according to a certain variable
make a reference to your root element layout: LinearLayout linearRoot = view.findViewById(R.id.linearRoot); Now it will be possible to have control over your properties:…
-
4
votes2
answers190
viewsA: Restart the layout
In place of: rv.swapAdapter(adapter,true); use: adapter.notifyDataSetChanged(); rv.setAdapter(adapter);
-
0
votes1
answer103
viewsA: Use Highest Precision Possible on Android GPS
Use Fusedlocationproviderclient and set the priority LocationRequest as PRIORITY_HIGH_ACCURACY See the details on accuracy in this link In short, the Google Play Services API has the intelligence to…
-
1
votes5
answers23968
viewsA: How to get and format current date and time?
Opa, blza!? You can get the current date of the classic Apis (Date), and also the new java 8 date and time Apis (LocalDateTime and LocalDate). Classical API to the java.util.Date: DateFormat…
-
0
votes1
answer118
viewsA: Pick item contained in a Listview item by clicking on the item
Opa, blza?! You could take the data according to the position of the clicked item: mListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?>…
-
0
votes2
answers39
viewsA: how to pass an item from a listview to a textview in the same Activity
mListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //aqui vc irá fazer a acao com o click…
-
-1
votes2
answers456
viewsA: Open an Activity by clicking an item in a list view
mListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //aqui vc irá fazer a acao com o click…
-
0
votes2
answers345
viewsA: Testing web server connection - Android
Opa, blza!? You can use the following function: public boolean isOnline() throws InterruptedException, IOException { String command = "ping -c 1 google.com"; return (Runtime.getRuntime().exec…
-
0
votes2
answers182
viewsA: Generate random number in a user-given range - Java/Android
Whoa, that’s all right!? the error is here: String minString = String.valueOf(minValue); String maxString = String.valueOf(maxValue); So vc is only receiving edittext, you need to convert the object…
-
-1
votes3
answers705
viewsA: How to click on Listview
mListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //aqui vc irá fazer a acao com o click…
-
0
votes2
answers320
viewsA: POST using Retrofit is not returning to the Onresponse function
I noticed something in its interface, in version 2 of the retrofit the data encoded by form are sent when @FormUrlEncoded. Each key value pair is annotated with @True of the name and the object…
-
0
votes2
answers488
viewsA: Video view resizing to video size
Oops, all right!? a while ago I had this same problem... but it was with images. My problem was this: I had a imageView which occupied a ratio of 2x1, within a LinearLayout, but according to the…
-
0
votes2
answers1682
viewsA: Is it possible to have a round button without changing the android:background attribute?
A floating action button (FAB) is a circular button that triggers the main action in your application’s user interface. This page shows you how to add FAB to your layout, customize some of your…
-
1
votes1
answer152
viewsA: Use of Spinner on Android
Whoa, that’s all right!? If I understand correctly, you want to create a spinner within a dialog, correct? Follow the example I have here: My activity_main.xml <?xml version="1.0"…
androidanswered Leonardo Figueiredo 517 -
0
votes1
answer152
viewsA: I can’t Post app to Google Play
Whoa, blza!? is your first publication? if it is, up there where you top the print have the information that is missing for you can publish. Generally it is content rating (which can only be done…
-
2
votes1
answer77
viewsA: Android: How to get username in Google Play Games
Opa, blza? Use the GoogleSignIn.getLastSignedInAccount method to request information about the currently connected user profile. GoogleSignInAccount acct =…
-
5
votes2
answers630
viewsA: How to check if any text was selected before copying it?
Whoa, whoa, whoa, whoa? To get the selected text is relatively simple. Follow the example: function isTextSelected(input){ var startPos = input.selectionStart; var endPos = input.selectionEnd; var…
-
0
votes2
answers183
viewsA: Welcome the logged in user
Whoa, that’s all right!? You simply create a Alertdialog on the user screen, creating the following function: public void mensagemSucesso() { AlertDialog.Builder alertaLogin = new…
-
0
votes2
answers313
viewsA: How to attach images from camera or gallery to Swift
Whoa, whoa, whoa, whoa? follows the code to do that action, native to Ios, does not spend adding any lib. import UIKit import Firebase import APESuperHUD class CadastroEleitorViewController:…
swiftanswered Leonardo Figueiredo 517 -
0
votes1
answer212
viewsA: Firebase SWIFT and Storage Image Gallery
Opa, blza!? What I did was this: every time I uploaded an image, I recorded in the user profile the path the photo was saved: func uploadImage() -> Void { let storage = Storage.storage() let…
-
1
votes1
answer99
viewsA: How to display a View only when the app starts on Swift 4?
Opa, blza? In his override func viewDidLoad() from your input view (the initial view controller), add the following code to call your Popupview. Doing this it will start the first view, and over it…
-
1
votes1
answer72
viewsA: Swift 3 on not accept http?
You need to set the Nsallowsarbitraryloads key as YES in the Nsapptransportsecurity dictionary in your file. plist. Open your . plist -> click + on the root -> Add the following line:…
-
-1
votes2
answers189
viewsA: Change the position of the maps map by clicking
You must use Cameraupdate to make these programmatic map movements. To do this, first calculate the limits of all markers as follows: LatLngBounds.Builder builder = new LatLngBounds.Builder(); for…
-
0
votes1
answer375
viewsA: How to address firebase notification to an app?
Whoa, that’s all right!? You will need the following: Class to make a request to the server and save the mobile id Other Box to receive notification. First do the Firebase Imports in build.Gradle…
-
0
votes1
answer493
viewsA: Push notification in hybrid app
Whoa, that’s all right!? Even being just a webView on Android, vc can implement some classes and make native: Class to make a request to the server and save the mobile id Other Box to receive…
-
1
votes2
answers205
viewsA: Use Ratingbar with numbering next to Android
Whoa, whoa, whoa, whoa? ifood works as follows: in this image you have sent, it is always a static star (even an imageView), the numbering (Textview) is a return of the API (which probably returns…
-
1
votes1
answer419
viewsA: Delete a user from firebase Auth when an Activity is destroyed
Opa, blza!? It will be on onDestroy itself, but before deleting a user you need to authenticate it again, then take the data from the previous Activity and pass to this: final FirebaseUser user =…
-
0
votes1
answer62
viewsA: Actionbar disarranged after updating Android Studio
Whoa, that’s all right!? Here also happened this, for her to return, just you click on that little eye that is just above the view, then check the option Show Layout Decorations.…
-
0
votes1
answer158
viewsQ: Android Studio Update: preview adding shadow in XML
Since the last update to Android Studio 3.3, a shadow appeared on each of my elements in the XML preview layout. Although it doesn’t appear in compiled rendering, it gets in the way of editing. How…
-
2
votes2
answers155
viewsA: Problem with Android Arraylist
You are setting the setImageResource with an int, your getList is not returning anything but an empty array. While your getCount in your Adapter is taking into account the amount of listName.size();…
-
0
votes4
answers496
viewsA: Hide element from Activity
INVISIBLE This view is invisible, but still occupies space for layout purposes. GONE This view is invisible and does not take up space for layout purposes. As you can read, INVISIBLE will hide the…
androidanswered Leonardo Figueiredo 517 -
0
votes1
answer222
viewsA: Firebase Database Android does not recover data by class
Oops, good morning. blah!? check on the following line classe1 cla = dataSnapshot.getValue(classe1.class); You are taking all the firebase snapshot, the correct would be to put the patch you want,…