Posts by viana • 27,141 points
761 posts
-
3
votes1
answer193
viewsA: How to disable scrollView interaction on the user screen?
You can create a custom scrollview. import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.ScrollView; public class CustomScrollView…
-
0
votes1
answer93
viewsA: Delete gridview item from gallery photos
There are several ways to solve this problem. I will specify one of these ways. First you can use the method setOnItemClickListener which refers to the long click on an item in the grid. Soon after…
-
1
votes2
answers360
viewsA: Android, how to do security in JSON?
There are several security methods for this case, however a basic method, which is the least you could do, would be to use an encrypted key at both ends of the connection. In this first case, using…
-
1
votes2
answers2513
viewsA: Exception in thread "main" java.util.Inputmismatchexception
If its value is 2.5 enter as input 2,5 using the comma ,.
-
1
votes3
answers514
viewsA: Return number of days for the end of the year
If you want a solution using JAVA 1.8+ , you can use the Chronounit, otherwise you can also do this way below using Calendar and Gregoriancalendar compatible with lower versions: Calendar data1 =…
-
2
votes1
answer333
viewsQ: Regular expression to identify text box in HTML form
Situation Give up a page in any HTML where there is a form containing, at first, two text boxes, one for name and the other for email. Then came the need, to do some tests on Android, to get just a…
-
1
votes1
answer4865
viewsA: Pick up Current Location by Google Maps and enter the address in a form
The consumption of the following URL below, returns exactly one json. So you can interpret it and fill out your interest form, whichever way you prefer. See:…
google-mapsanswered viana 27,141 -
1
votes1
answer434
viewsA: Open Whats contact through href
Take a look at documentation Whatsapp, but basically you need to do this way to send a text: <a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>…
-
0
votes3
answers629
viewsA: Why does my Actionbar due to an error stay inside my Statusbar?
Add to the root of your layout Activity_Main.xml the following attribute: android:fitsSystemWindows = "true" The fitsSystemWindows is an internal attribute to adjust the layout of display based on…
-
0
votes3
answers1431
viewsA: Hide object with Javascript
Do it that way: document.getElementById('form-tab-1').style.display = 'none'; And in being form there has to be the id with the same identifier, in this way: <form id="form-tab-1">…
-
5
votes3
answers1511
viewsA: How can I replace a part of a string by itself plus the "~" character?
String.Replace (String, String) Returns a new sequence in which all occurrences of a String specified are replaced by another specified String. Syntax public string Replace( string oldValue, string…
-
10
votes2
answers27501
viewsA: How to verify if a number is even or odd?
In PHP, as there can be in several other languages, a way to know if a number is even or odd, you can use the operator %, mean MOD, to calculate the "rest" of the value division. If the rest of the…
-
2
votes2
answers139
viewsA: Return record with highest number of appearances
You can show this way using the following query: SELECT id, nome, count(nome) quantidade FROM tblPessoas GROUP BY nome ORDER BY count(nome) desc limit 1 Upshot…
-
1
votes1
answer162
viewsA: Load Google Maps without internet - Android
Can you do this using a class called TileProvider, which deals with creating a collection of images displayed on the blocks of the basic map. So, there goes creativity, you can write in the device…
-
0
votes2
answers981
viewsA: What is the reason for the error "The Operator / is Undefined for the argument" in this code?
Try closing the parenthesis once more by making your operation isolated, this way: double t1 = System.currentTimeMillis(); double t2 = System.currentTimeMillis(); System.out.print("\n Tempo Total:…
-
15
votes2
answers3894
viewsQ: Error message: "java.lang.Illegalstateexception: package not installed?"
Situation I’m getting this kind of mistake in mine logcat and I don’t know exactly what it could be. Although this error is not compromising the operation of the application (as far as it is…
-
1
votes1
answer106
viewsQ: Assign a color to the added image with "android:drawableLeft"
I have a due case that I am using three images for each of my buttons, as shown below the images: ic_palette_black_36dp ic_palette_red_36dp ic_palette_blue_36dp Code: <Button…
-
9
votes4
answers15337
viewsA: Security - What is a KEY API?
API Basically an API is a set of routines and programming standards for access to a software application or web-based platform. The acronym API refers to the English term "Application Programming…
-
1
votes1
answer128
viewsA: Error starting Android Studio after update
Includes the bin at your address jdk, the line below in your system variables. Here is a tutorial how to edit system variables in linux. JAVA_HOME = "/usr/local/jdk1.8.0_73/bin Or maybe it’s about…
-
1
votes1
answer753
views -
2
votes1
answer133
views -
0
votes2
answers332
viewsA: How to show a call activity when the device is locked and turned off
One of the things you need to know is basically Run a Service in the background on Android. Remembering that to create a service, you must create a sub-class of Service that in its implementation,…
-
0
votes1
answer72
viewsA: Error while performing android route : Androidhttpclient: Leak found
Try when finishing your AndroidHttpClient using client.close() to shut it down. Androidhttpclient created and Never closed This message above says that a variable of the type has been created…
-
2
votes2
answers143
viewsA: Error placing image on Imagebutton
This error is a memory leak. Your application is assigned a size of ~ 24MB. But the images you’re trying to set maybe, I say maybe they are, are the size of the stack. This is happening because you…
-
1
votes1
answer416
viewsA: Save the instance of a Fragment
Look, you can use the very life cycle of fragment like the onActivityCreated. Usually this kind of situation of losing data and having to recover happens, for example, when the screen is rotated. In…
-
1
votes1
answer112
viewsA: Loop in Carousel
I had an idea to do it this way, but there are other ways to do it. Main public class MainViewPage extends AppCompatActivity { ViewPager mViewPager; int[] mResources = { R.mipmap.imagem1,…
-
1
votes2
answers177
viewsA: Error using Radiobutton gettext() method
You’re calling a rb.getText() without instantiating. You should add there in your MainActivity: rb = (RadioButton) findViewById(R.id.rb);
-
4
votes5
answers2439
viewsA: Subtract sums of fields in two separate tables
You will have to see which table comes first and do so by playing the value in a total: SELECT (SUM(qtdsaco) - (SELECT SUM(qtdsaco) FROM armazem2)) total FROM armazem…
-
0
votes1
answer564
viewsA: Check user status when logging in
From what I understand of your system, you would have to make a change in your class AppUserDetailService.java, by inserting the condition of status. Make a check if the usuario returns other than…
-
2
votes2
answers617
viewsA: I have the status and city ID, and now what?
Considering these tables created according, apparently, with their structure we would have it: Ad Table -- -- Estrutura da tabela `tb_anuncio` -- CREATE TABLE IF NOT EXISTS `tb_anuncio` ( `id`…
-
0
votes1
answer224
viewsA: I would like to make a point limit for my game developed on android
You can create a method that checks the score by passing through the parameters the points the user earns during the course of the game, for example verificaPontuacao(int pontos);. Then, within the…
-
1
votes5
answers434
viewsA: Meta Author does not embed when sharing on Facebook
With Yoast Wordpress SEO plugin With the plugin Yoast Wordpress SEO, you need to enter SEO » Social page in Wordpress administration and check if box next to "Add Open Graph meta data" is marked.…
-
4
votes3
answers604
viewsQ: High-box text button in Android API < 14
We see that at the launch of Android 5.0 Lolipop came Material Design that has indeed changed a lot on Android and along with this, the component of Dialogs which by default comes with the high text…
-
2
votes1
answer2200
viewsA: How to make a Carousel?
Come on! First you need to create an element ViewPager within your xml in this way res/layout/activity_main.xml: XML <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"…
-
1
votes1
answer679
viewsA: java.lang.Nullpointerexception error on android application
Try it this way then: Classes public class PrimeiroLayout extends Activity { private Button botao; private RelativeLayout relative; @Override protected void onCreate(Bundle savedInstanceState) {…
-
0
votes1
answer82
viewsA: Remove default map tags on android
To remove bookmarks that are added to Google Place for addMarker, which in this case would use googleMap.addMarker() you can do so: marker.remove() The addMarker method is: public final Marker…
-
0
votes3
answers344
viewsA: Determine the page where the *.pdf file will open in the browser
There’s a way you can do it using page using this parameter #page=[pagina específica], then it would look like this if the file is at a specific local address: file:///C:/meuarquivo.pdf#page=3 If…
-
0
votes1
answer478
viewsA: Use wordpress login on another site
There is a filter login_redirect is used to change the redirected location after logging in. This could be the location defined by the "redirect_to" parameter sent to the login page. There on your…
-
0
votes1
answer667
viewsA: Transparent toolbar on Android
Elevation That "shaded line" that concerns you elevation. You can remove setting the value of it to 0dp. Then your code would look like this: <android.support.v7.widget.Toolbar…
-
0
votes1
answer78
viewsA: android:layout_height="fill_parent" from Viewpager does not work
It is recommended that developers use the new "match_parent" template. And for older applications, of course compatibility continues to exist. Try changing your layout to match_parent.…
-
6
votes2
answers1280
viewsA: The location obtained by getLastLocation() always returns null
As warned our friend in the comments, I decided to improve the response by posting two ways to capture GPS, using GoogleApiClient and using LocationManager. Under conditions of Android 6.0(Api level…
-
1
votes1
answer452
viewsA: Scrollview with Relativelayout
You have to let your ScrollView take up all the space on the screen by changing its height to match_parent, then yes so all content that is inside match_parent: View must occupy the same space as…
-
1
votes1
answer292
viewsA: Camera appears with black screen. Error fail to connect to camera service
Use SurfaceView for your camera view as you describe the documentation on the website of Android itself. Under the conditions of Android 6.0(Api level 23) exists the Requesting Permissions at Run…
-
1
votes1
answer4049
viewsA: Error when publishing app to Google Play
Google Play does not accept a debugging version of your file .apk . You can only send one .apk compiled as release version. In addition, it must be signed with the Android developer key. Be sure to…
-
2
votes1
answer312
viewsA: Nosuchelementexception error when executing application
Get in the Compile and Run Java Online and ask to execute your code. It is compiling normally. There you will enter the data referring to the notes as it is in the code. After typing the 3 notes,…
-
1
votes2
answers305
viewsA: Is it possible to run Acrobat Reader without putting all the way of its executable?
You would have another alternative to open a file .pdf, but so: public static void main(String args[]) { try { // o arquivo myfile.pdf sera aberto assim Runtime.getRuntime().exec("rundll32…
-
2
votes1
answer549
viewsA: How do I update a proprietary app?
If you would like to check if you have app updates (without interacting with Google Play), you would obviously have to put the app on a server (providing your current version) and leave the server…
-
1
votes2
answers138
viewsA: I am trying to extend Stringrequest from Volley package, but the import is not working, why?
Gradle? It is to eat or to pass in the hair? Android Studio is based on Jetbrains' Intellij IDEA, which has as one of its main Features, and often ignored, a much more modern build system based on…
-
3
votes1
answer9344
viewsA: How to make a Floating Action Button?
Floatingactionbutton There is a guide to using the library that explains how and when to use the floating button correctly in new or existing projects. Example of use:…
-
1
votes1
answer385
viewsA: Error in build. Gradle
Check your version of Grandle and try to update it. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.3' //insira um versão mais recente } }…