Posts by LMaker • 901 points
55 posts
-
0
votes1
answer57
viewsA: Text breaking in Android notification Using upstream FCM
Within your FcmListenerService add the attribute setStyle of NotificationCompat. Will stay like this: NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)…
-
1
votes1
answer48
viewsA: Publish applications in Stores that differ by small details
You can use the Product Flavor. According to the documentation: Product Flavors represent different versions of your app that you can release to users, such as free or paid versions of your app. You…
-
1
votes1
answer39
viewsA: Add a new "Android Resource Directory" to the project
I believe you can’t put a folder with a different name than the default one within res. What you can do is put these images inside assets, there you are free to rename the folder as you wish.…
-
0
votes2
answers345
viewsA: Edittext vehicle mask
I have a class for that I used once: class LicenseVehicleMask(var editText: EditText) : TextWatcher { private var isUpdating: Boolean = false protected var mOldString = "" protected var mMask:…
-
0
votes2
answers204
viewsA: Map navigation intent for all apps [mount route]
You can use this Xtension: fun Activity.openMaps(latitude: String, longitude: String) = try { val uri = "geo:$latitude,$longitude" startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(uri))) } catch…
-
0
votes1
answer1558
viewsA: line breaking of an edittext automatically on android
You can use the attributes maxLines and/or inputType, that way: <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="5"…
-
2
votes1
answer33
viewsA: Close Activity if Idle
I usually create applications for interactive totem systems, which always require a timeout. I’ll try to explain how I do it: First I create a class that extends from Application, here I’ll call her…
-
0
votes1
answer46
viewsA: Problems with popup menu and Immersive Mode
Try to add that to your Activity: @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) {…
-
0
votes1
answer1293
viewsA: Delete database when uninstall app
From the Android Marshmallow there is a new Feature, where inside the <application> you must set a value for the attribute android:allowBackup. In your case: android:allowBackup = false…
-
1
votes1
answer72
views -
0
votes1
answer99
viewsA: How to make a PDF file in my APP’s Assets open by the android’s native PDF reader?
file://android_asset is visible only to your app. You’re wanting another app to open a folder file assets that he does not possess. What you can do is copy this file to the internal or external…
-
0
votes3
answers1859
viewsA: How to get the serial number (not the IMEI) of iOS and Android devices?
getDeviceId() Returns the Unique device ID of a Subscription, for example, the IMEI for GSM and the MEID for CDMA phones. Return null if device ID is not available. Source:…
-
1
votes2
answers108
viewsA: Automatic user address search
Well, I’ll split my answer into two parts: Perform the search when the user enters the zip code in the form field: cep.setOnFocusChangeListener(OnFocusChangeListener { _, hasFocus -> if…
-
3
votes1
answer154
viewsA: how to hide an item in the menu
All you have to do is instantiate the menu: Menu menu = navView.getMenu(); and set the attribute visible menu.findItem(R.id.my_item).setVisible(false); Already the mistake unreachable statement…
-
0
votes3
answers422
viewsA: How to pick any button through Onclick?
Look, I was pretty sure that this is something that is possible to do yes. I got that flea behind my ear, and I decided to test it quickly. The result was that both buttons were left with the text…
-
3
votes1
answer46
viewsA: Bottomnavigationview does not work on first click
That’s because you’re wearing the setOnNavigationItemReselectedListener. As the name says, Reselect, is only called when the item is already selected and is again clicked. For your case, use the…
-
1
votes2
answers70
viewsA: Why can’t I use Onbackpressed Listener within Ragment
You can create a Reader for that, something that will take a good handful of code, or you can use the onDetach in his Fragment to do this. @Override public void onDetach() { super.onDetach(); SEU…
-
2
votes2
answers804
viewsQ: Brazilian telephone mask
I’m migrating from Android to iOS now, and I’m having a question. I can do on Swift something like onTextChanged java? I need a Mask for my UITextField which is dynamic according to the number of…
-
2
votes1
answer69
viewsA: How do I put a list in Undeserving with Recyclerview in Android Studio
The ideal way would be to make one order on the server, where you get the data from the list. But you can also use one Collections.reverse(mList); to reverse the order of your ArrayList.…
-
2
votes1
answer383
viewsA: Switch Android catching Varialvel
Use the Entrega.isChecked(), that returns a boolean with the Switch value.
-
0
votes1
answer148
viewsA: My app does not return JSON data
You are trying to parse an array using an JSONObject, causing him to fall into his catch. Try to do something like this, appropriate to your situation: JSONArray jsonarray = new…
-
0
votes1
answer115
viewsQ: Swift - Send json body through the still
I’m on my first project on Swift, and I need to send a RequestBody in the POST by Alamofire. This is an example of JSON I need to send: { "user":{ "email":"[email protected]" } } And I have my…
-
0
votes1
answer173
viewsA: Why does Progressbar hide behind the button?
The problem is you’re not saying about what Progress should be. Just add android:layout_below="@id/btnLogin" and the magic will come true. Another option would be to use one LinearLayout guided…
-
2
votes1
answer325
viewsQ: Using an Activity/Fragment on a bottom sheet
I was doing a study on the Bottom Sheet, and I built something similar to this tutorial link. I was wondering how I could put together something similar to what the Uber app does. It is a bottom…
-
1
votes1
answer571
viewsA: How to get Firebase notifications received in the background?
The fact that you are not receiving the message when the application is in the background is why the object of push is being sent as Notification. The correct for what you receive in the background…
-
1
votes1
answer171
viewsQ: iOS - Changing the height of a Text Field inside Uistackview
I have a layout I’ve assembled using StackView. So I have a StackView vertical with some TextField, and two StackView horizontal inside. I now want to change the height of the textfields, thing the…
-
1
votes4
answers364
viewsQ: Swift 3 - How to persist objects
I’m an Android developer and I’m trying to learn some things for iOS as well. I have hit myself a little on simple things, like saving persist an object of mine to catch it again another time. On…
-
0
votes1
answer104
viewsA: Capture the current user location in a time interval and send it to the server
You will wear a AlarmManager that initiates a Service every X sec, as long as you want. The Service must include a class that implements a location listener. And you just get the location inside a…
-
1
votes1
answer94
viewsA: Error while trying to generate signed APK. What may be wrong?
I believe the problem may be <service> out of <application> Try it this way and see if it resolves: <uses-permission android:name="android.permission.INTERNET" />…
-
0
votes2
answers255
viewsA: Error while receiving Firebase data
Your onDataChange already receives a DataSnapshot as a Child-Node. You just need to use the getValue of DataSnaphot without using a looping: @Override public void onDataChange(DataSnapshot…
-
1
votes1
answer34
viewsQ: Library to load custom maps?
I’m looking for a component that works like the Google Maps (navigation and zoom) where I can upload my own map. It’s a very simple map. I found the mAppWidget but I found few examples of…
-
1
votes3
answers746
viewsA: Toast with specific duration
For Toast there are only 2 flags: LENGTH_SHORT and LENGTH_LONG. That is, are values already defined. To meet what Oce needs, we need to do something more the Brazilian way. It would be something…
-
1
votes1
answer207
viewsA: Changing label and color of pie chart entries - Android
I worked only yesterday with this lib, and really it’s kind of complicated. But there goes: Label: To add the label of each part of the chart, Voce must instantiate its PieEntry with Valor (float)…
-
1
votes0
answers46
viewsQ: Using a custom map
I’m trying to create a map from an image .png that I have. Something like the Beto Carreiro app. Does anyone know any lib that I can do this? I tried to use the Mappwidget and the TileView…
-
0
votes1
answer283
viewsA: How can I take a specific item from a listview and place it in another Activity?
Make your student class implement the interface Parcelable. After, add after the onItemClick of listview: startActivity(new Intent(getBaseContext(),Activity.class).putExtra("aluno",object)); So in…
-
1
votes1
answer178
viewsA: How to make that when creating multiple imageview , it go to the other side?
You can do it using one RecyclerView. You will create an Adapter, which you will manage when you add a new image to open a new square on the side. It would look something like this:…
-
-1
votes1
answer126
viewsQ: android - Unit testing and UI testing
Good morning friends, lately I have seen some videos and blogs on the subject, and wanted to know who usually works with tests if it is really worth using tests on Android dev. And if so, which…
-
0
votes1
answer49
viewsQ: Have more options in action_send dialog
I’m using the action_send, but it does not give me the options of Whatsapp, facebook, and other social networks. Only Gmail and Message. Code I’m using is: Intent share = new…
-
5
votes3
answers6177
viewsA: Date Mask in Edittext
I usually wear one Masked Edittext in this case, where the component does everything for us. Just take a look at Git https://github.com/VicMikhailau/MaskedEditText In your case it would look…
-
3
votes1
answer4234
viewsQ: retrofit - How to send a JSON via POST
Talk guys, I’m using Retrofit 2 and I’m not getting JSON to WS. I have here my class that tidies up the json the way I need it: Customgsonadapter public class CustomGsonAdapter { public static class…
-
0
votes1
answer271
viewsQ: Elevation is not displaying the shadow
Despite defining the elevation us RelativeLayouts, the shadow does not appear in the component. What can be? Below is my layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout…
-
2
votes1
answer134
viewsQ: How to restart a service to call the oncreate again?
Hey, guys, let’s go I have a service and I have all his logic on Oncreate. The problem is that I need it to go through the oncreate again when I perform an interaction on my Activity. I’ve tried…
-
2
votes3
answers664
viewsQ: Request within a defined time interval
My application should update a list of data coming from the server every 5 minutes. Using Retrofit for Request HTTP, what’s the best way to do that?
-
3
votes1
answer334
viewsQ: Countdown counter with alarm
I have a project where I start a 10min action, for example, and so starts a countdown. This counter will be shown on a screen for management (it can add +1 minute, as the timer of widget android…
-
4
votes1
answer421
viewsQ: android - Image cache and display listview
Good afternoon, my friends, The thing is, I’m going to use Volley to get the data from the webservice, and so I write the list to my local BD with Sqlite. In this webservice will come a JSON with…
-
1
votes3
answers801
viewsQ: Replace in the javascript array
Good afternoon, friends I’m having a problem here in javascript. I have an array, but with each Dice it is adding a double quote, and I want to remove them from there. My code is like this: dados =…
-
3
votes4
answers3189
viewsQ: Access JSON with multiple JS objects
I have the following JSON [ { "id": 1, "nome": "Matheus Almeida Siccenna", "cpf": null, "matricula": { "id": 555, "empresa": 1, "unidade": 0, "descricaoUnidade": null, "curso": 1, "descricaoCurso":…
-
1
votes1
answer208
viewsQ: PHP and Highcharts, doubt list series
I made a query with php and am iterating with my array using Foreach to set in Highcharts the values as follows: series: [<?php $i =0; foreach($result as $rs) { ?>{ name: '<?php echo…
-
0
votes1
answer74
viewsA: Time period in php
In the matter of dates: You can use the SQL "now()" function to work with periods of time. you do a query by comparing the date of the event and place within an array, so you will only have the…
-
0
votes1
answer100
viewsQ: Problem with Nav css boostrap menu
I’m trying to make a menu by following this template here: But since not everything in life is flowers, I can’t possibly leave one border and the text in the middle, centered between the same edges…