Posts by viana • 27,141 points
761 posts
-
1
votes3
answers686
viewsA: Programmatically change the background color of the Overflow Menu in the Toolbar
You can work on your style.xml Android Api >= 21: <style name="AppThemeLillipopOuSuperior" parent="Theme.AppCompat.Light.DarkActionBar"> <item…
-
29
votes2
answers11436
viewsQ: What is the difference between Boolean and Boolean?
I performed some tests using Boolean and boolean and apparently returned the same result. See below: Boolean bool = true; boolean bool2 = true; if(bool) Log.wtf(TAG, "Funciona!"); if(bool2)…
-
1
votes2
answers194
viewsA: Nullpointerexception error using Boolean type
Try to put a value default for your variable saved: private Boolean saved = true;
-
4
votes1
answer230
viewsQ: Show emoticons with independent keyboard button
I am developing an application in which I created a button that I would like you to do the same function of showing the emoticons keyboard. This image: btnMostrarEmoticons.setOnClickListener(new…
-
1
votes1
answer269
viewsA: Listing internal memory files in Listview
Thinking a little bit it is possible to make several internal and external device listings in an application using the Environment and Context. Environment.getRootDirectory(): Returns the root…
-
3
votes1
answer1313
viewsA: Creating custom Toolbar, action bar
By default there is a spacing in the Toolbar of 16dp, then it is necessary to use the method contentInsetStart defining it as 0dp. Read more about Metrics & keylines in documentation Material…
-
0
votes2
answers2623
viewsA: Square Root in C
Clear the spaces in the scanf: scanf("%lf%lf", &x1, &y1);
-
2
votes2
answers1178
viewsA: How to use Scrollview and Linearlayout with full screen height?
Thinking a little bit about your code, I realize that you don’t need to use a ListView within a ScrollView, that maybe, I say maybe it is not good practice. So that you do not see just one item as…
-
0
votes3
answers50
viewsA: Apache2 error on linux
You can reset your root password. Keep in mind that it is not advisable to use root without password. Soon after you have to restart the service so that the changes work properly using: sudo…
-
1
votes2
answers1230
viewsA: Back button on Xamarin Cross Platform
Talking about Xamarin.Forms by "Cross Platform Xamarin", you must use the OnBackButtonPressed. But remembering as it says in the documentation: The event is generated when the 'back' hardware button…
-
1
votes1
answer498
views -
3
votes1
answer574
viewsA: How do I publish a specific APK for Android versions greater than $API?
One way to do this is to check the version of Build within its application using android.os.Build.VERSION, which is a static class that contains various information about the Android operating…
-
1
votes1
answer53
viewsQ: Eclipse Configuration
I have a project android raised in the eclipse. In this project in the table of Problems I have some warmings (907) as shown in the figure below: As we understand it, it appears this way: 0 errors,…
-
8
votes1
answer698
viewsA: Error:Execution failed for task ':app:transformClassesWithDexForRelease' de Lcom/google/android/gms/Internal/zzbw; Would anyone know this error?
As far as we can tell, you’re using a lot of external libraries. Considering this, we have to perhaps, I say perhaps, exceed the total limit of methods to be referenced in your project. Explanation:…
-
1
votes1
answer1244
viewsA: Android app in the background
A Service is a component of what can perform long operations and does not provide a user interface. Another application component can start a service and it will continue running on background even…
-
1
votes2
answers344
viewsA: How to put items in a Listview
The class ListView has no method Add. You first need to create a List or ArrayList so that you can list inside your ListView.…
-
7
votes2
answers10914
viewsA: Data type for latitude and longitude
I use it this way and it always worked: lat DECIMAL(10, 8) NOT NULL lng DECIMAL(11, 8) NOT NULL Considering: Latitude 40.71727401 Longitude -74.00898606 Read this article which explains how Mysql…
-
0
votes3
answers886
viewsA: Fragment error "Unable to start Activity"
In his .xml appears in this way R.id.fragmentDetail and in your class you call R.id.frag_detalhe. Try to check and correctly put the identifiers because they are with ids different. Another possible…
-
5
votes3
answers5735
viewsA: What is the basis for.Oncreate(Bundle) and what is Bundle?
onCreate() Being part of the Click on Activity Life, the onCreate() is the method responsible for loading layouts and other boot operations. The complete life cycle of Activity occurs between the…
-
3
votes1
answer545
viewsA: Error while running Eclipse after Windows 10 installation
Most desktop applications written for the Windows 7 and to the Windows 8.1 also work in the Windows 10, But it’s possible that some old applications malfunction or don’t even work. If an older…
-
1
votes3
answers768
viewsA: Error installing PHP - "The program can’t start because MSVCR110.dll is Missing"
Many people when installing Wampserver come across an error at the time of launching the application saying that the file is missing MSVCR110.DLL. This error is actually caused by the lack of an…
-
2
votes1
answer2284
viewsA: Using Imagemview to upload gallery photo
First step Give read permission using READ_EXTERNAL_STORAGE for gallery photos on manifest.xml: <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> Second step Create a…
-
3
votes2
answers6589
viewsA: What is the file . env in Laravel 5?
What is the file . env? The archive .env is an easier way to load custom configuration variables that your app will need to have. This means that you will have to modify the file outside of the…
-
0
votes1
answer152
viewsQ: Meaning of Warning: Possible overdraw
I have an app that shows Warning: Possible overdraw: Root element Paints background @color/md_elegance_green with a Theme that also Paints a background (inferred Theme is…
-
0
votes1
answer456
viewsA: Save tts as audio file
Alternative 1 The library Texttospeech does not support audio recording, however, may try to enter recording mode while you speak through the class Mediarecord: MediaRecorder minhaRecorder = new…
-
0
votes1
answer581
viewsA: How to use HTML files from the Assets folder in a Webview
You’re not closing your HTML. Insert after your </body> the </html>.
-
3
votes2
answers237
viewsQ: What is the purpose of baselineAligned?
In the act of developing an application, I came across the following Warning: Set android:baselineAligned="false" on this element for Better performance What purpose of baselineAligned? When should…
-
4
votes1
answer2263
viewsQ: What is the purpose of contentDescription?
I have in my application I have several Warning's as stated below: [Accessibility] Missing contentDescription attribute on image Imagery I did some research and found that it’s about the…
-
3
votes1
answer303
viewsA: Variable that changes according to the button pressed
First you have to initialize your variable by setting a value for it. Ex.: 0. public int variavel = 0; To avoid error, simply insert "" before the variable. See below: textoid.setText(""+variavel);…
-
0
votes1
answer143
viewsA: Trouble catching latitude and longitude
The problem is that you’re just checking for permission, but not asking for permission to be granted. Below follows a method that checks and already grants permission using requestPermissions()…
-
1
votes1
answer576
viewsA: Browse between screens
For this case, it can be used Viewpager. In the android documentation has an example ready to download. See the image:…
-
0
votes1
answer104
viewsA: Add scroll in window
Make a JPanel scrolling using JSCrollPane in this way: JPanel container = new JPanel(); JScrollPane scrPane = new JScrollPane(container); add(scrPane); Details How to Use Scroll Panes…
-
4
votes1
answer306
viewsA: Adjust Alertdialog with Open Keyboard
If the EditText is inside your Dialog, will do just that. A possible solution is you define the InputType of your EditText. Then you will be able to use the event on your keyboard, in which by…
-
2
votes1
answer76
viewsA: Android SDK error could not be found
Download the SDK from Android from the official website. Then open the manager of SDK and download the necessary supplements. After that select the location SDK in the preferences of Xamarin.…
-
1
votes3
answers109
viewsA: I made a Splashscreen it carries and it does not go to the Activity prixima what should I do?
Try to customize your code as much as possible using a few lines of code. Take a look below at how I do a Splashscreen. Class Note: Don’t forget to finish the Activity using finish(), so that it is…
-
2
votes1
answer281
viewsA: Text gradient android
It does not seem possible to create TextView with gradient text only using XML. However it is possible to achieve this effect by creating a canvas and drawing on it. It is necessary to declare our…
-
0
votes2
answers219
viewsA: How to create custom Toolbar like Acmarket
One option is to place your toolbar Toolbar within a CardView, so to distance a little from the edge, it is necessary to use the property layout_margin setting it the value you think best. Below…
-
4
votes1
answer59
viewsA: One tap for more than one event
You can explore more about Multi-touch Android, which is available from the Android 2.0 and was improved in the version 2.2. The MotionEvent.ACTION_POINTER_DOWN and MotionEvent.ACTION_POINTER_UP are…
-
1
votes1
answer1273
viewsA: Know if Activity is open (Broadcastreceiver or service)
You can use a static variable within the Activity, so you can define it by exploring the life cycle onStart() and onStop(). Behold: class MinhaActivity extends Activity { static boolean active =…
-
15
votes2
answers468
viewsA: Meaning of "__"
The use of two underscores ('__') in identifiers is reserved for internal compiler use according to the ANSI-C Technical Standard. In practice, this is done to avoid a collision with…
-
0
votes1
answer209
viewsA: Error Mysql and android connection
The error happens because you have not specified the compatibility options in the module itself. It usually happens if your project is with JDK 7, but is installed and using JDK 8, then all modules…
-
7
votes1
answer354
viewsA: How to make a Floatingactionbutton square or rectangular?
One solution to make it square would be to use borderWidth inserting 0dp for your FloatingActionButton. Then it would result in: Code app:borderWidth="0dp" Floatingactionbutton:…
-
3
votes2
answers416
viewsA: List always returns only the first row of the sqlite database
Use moveToFirst(). Considering the documentation of Sqlitedatabase it is said that: A Cursor object, which is positioned before the first entry. The moveToFirst() does two things: Allows testing…
-
1
votes2
answers2225
viewsA: What is and how does a Static block work in Java?
A static block is executed only once, immediately after the first reference to class, that is, in memory loading. Like the static block is executed on class loading, hence it will be executed before…
-
4
votes1
answer564
viewsQ: When should I use mipmaps?
After Google started adding Mipmaps I ended up not researching exactly why. Even with this addition, it does not prevent anything from using the Drawable as before. Before res/…
-
2
votes1
answer404
viewsA: Firebase Cloud Messaging x Google Cloud Messaging
What a difference between firebase cloud messaging and google cloud messaging? The Firebase Cloud Messaging (WCF) is a cross-platform messaging solution that allows reliable delivery of messages and…
-
2
votes2
answers1006
viewsA: How to reload an Activity
You have to explore the life cycle of his Activity using the onResume(). You’d have to put your search back into the method. @Override public void onResume(){ super.onResume(); // coloque sua busca…
-
1
votes1
answer122
viewsA: Map no longer works
You may have to add the plugin from Google services to your archive build.gradle. You need to create a file google-services.json to guard the project_id and api_key in JSON format for all Google…
-
6
votes1
answer605
viewsQ: Why is it recommended to use "sp" instead of "dp" in text sizes?
Bearing in mind that when we use the unit sp in the TextView there’s always a Warning in this way: Should use "sp" Instead of "dp" for text Sizes In this Sopt response shows exactly the difference…
-
1
votes1
answer342
viewsA: Take mysql data and use in Mapsfragment on Android
There are some distinct ways that it is possible to solve your problem by returning same result using JSON or XML. At first it is necessary to structure the information returned from PHP in a…