Posts by viana • 27,141 points
761 posts
-
9
votes3
answers7003
viewsQ: How to make Local Storage expire?
I have a certain scenario in which I need the user to stay login and stay connected for some time. However, if inactivity is detected on the page after a while, maybe 20 min, expire the Local…
-
0
votes1
answer677
viewsA: Select Tab in Tablayout(android)
You just need to do it this way below to make it work properly. public class RegrasTab extends AppCompatActivity { /* objetos referente as tabs*/ private TabLayout tabLayout; private ViewPager…
-
3
votes2
answers1865
viewsQ: How to create a shortcut within a page?
To add a new item in my database there is the button Add, however I would like to add a shortcut for you to perform the same function as the button. For example when the And in any question in the…
-
3
votes1
answer260
viewsA: Problem to install gcc in Ubuntu
For security measures, when you execute the command sudo on Linux, the Terminal asks you to enter your password without feedback visual while you type. Even if no character appears while you type…
-
18
votes3
answers66206
viewsQ: Is there a shortcut to indenting the code in Sublime 3?
It is noticeable that in several IDE’s there are some shortcuts to indent the code. For example: Eclipse(Win): Ctrl + Shift + F Android Studio(Win): Ctrl + Alt + L As everyone* knows, I assume,…
-
2
votes1
answer53
viewsA: Connect by clicking a button
To make phone call on Android directly, you must use ACTION_CALL. See how it would look: Intent call = new Intent(Intent.ACTION_CALL); call.setData(Uri.parse("tel:"+celular)); startActivity(call);…
-
1
votes1
answer598
viewsA: Opening an Activity and returning saving the main state
Insert the onOptionsItemSelected in your class Meditate using android.R.id.home to finalize the Activity current. See: @Override public boolean onOptionsItemSelected(MenuItem item) { // ação voltar…
-
1
votes1
answer126
viewsA: How to add an icon showing that that item has already been read, being saved the preferences using Sharedpreferences?
As you mentioned, for relatively small collection of key values to save cases, use the Apis Sharedpreferences. An object SharedPreferences indicates a file that contains key value pairs and provides…
-
0
votes2
answers90
viewsA: Public with 2 variables does not return value
First tip is to check if the values are being filled in correctly. For example in your first method volume_agua_mehta(), check whether the variable resistencia_concreto is receiving the desired…
-
3
votes2
answers743
viewsQ: Extract arrays and objects from JSON returned with jQuery
I’m making a request on a web service using jQuery this way: var dados = jQuery( this ).serialize(); jQuery.ajax({ type: "POST", url: "http://meusite.com/test", data: dados, success: function( data…
-
1
votes1
answer361
views -
0
votes2
answers498
viewsA: How can I easily make application location permission?
From the Android Marshmallow, API 23, users grant permissions to applications while they are running, not when they are installed. This approach optimizes the application installation process, as…
-
7
votes1
answer1682
viewsA: Input type file does not work in webview
I will assist you according to the documentation of Webview. Following image scheme of the visual component WebView: Defining variables: private static final String TAG =…
-
3
votes2
answers622
viewsA: Canvas delete correct text
I assume using the method filterText() would already work for this case, replacing the old text with a new one. Just insert the code in this way: ctx.fillText(txt, 15, canvas.height / 2 + 35). See…
-
2
votes1
answer669
viewsA: How many apps you can have on Google Play
Nothing was found that talks about limiting the amount of Apks in the Google Play Publish developer account, but there is a limit that it is the daily amount that 15 APK. See the message returned to…
-
2
votes1
answer1242
viewsA: How to leave the first character uppercase on the keyboard?
Basically there are two ways to capitalize the first character on the keyboard, via XML and programmatically. See: XML Set up your ExitText thus using textCapWords|textCapSentences:…
-
1
votes4
answers304
viewsA: Leave part of the APP in library
With Eclipse you can create a JAR file containing the classes and project information. Unlike files .jar, AAR files, possibly created using Android Studio, can contain Android features and a…
-
1
votes4
answers398
viewsA: Use of self-reference
Although the this in this example you are referring to the same attribute, making no difference at all, in an instance or a constructor this is a reserved word that references the current object -…
-
2
votes1
answer583
viewsA: text error float beside html image
You can simply give an image margin using margin: 10px. Behold: .img-responsive { margin: 10px } #skill1 { } #skill1 img{ width:200px; background-color:#F60; float:left; } #skill1 p {…
-
7
votes5
answers2467
viewsA: What is a deprecated code?
Depreciated is a possible translation of Depreciated, that resembles Deprecated which means obsolete (which would be the most used in the programming area). As we use this word more in economic…
-
4
votes4
answers31300
viewsA: How to disable resize from textarea?
The estate resize controls how an element can be resized by the user by clicking and dragging the bottom right corner of the element. $('button').on('click', function() { $('p').css('resize',…
-
4
votes1
answer716
viewsA: Firebase reference error
Briefly the exception Nullpointerexception is launched whenever you try to access a memory object that has not been instantiated, or better initialized, until the moment of your call. Common causes…
-
0
votes1
answer67
viewsQ: Item is not deleted dynamically using foreach
I am in a small solvable impasse but not in my head at the moment. I have a list of items in which an delete button for each item. These items are removed by passing as parameter the UUID. If you…
-
2
votes1
answer1752
viewsA: Networkerror: 400 Bad Request
The mistake 400 Bad Request occurs when server cannot understand and process the corresponding request. Once you have checked if the server URL is actually correct, a possible solution is to encode…
-
3
votes2
answers404
viewsA: What is the difference between Alarmclock and Alarmmanager?
Although they are two totally different classes, see below for a brief explanation of each one: Alarmclock {public final class Alarmclock } Contains a set of constants and extras that can be used to…
-
1
votes2
answers536
viewsA: How to place 3 Adsense link ads side by side?
See if this way helps you: #ad { height: 100%; min-height: 100%; /* habilita o flex nos filhos diretos */ display: -ms-flex; display: -webkit-flex; display: flex; /* centraliza na horizontal */…
-
5
votes2
answers775
viewsA: What is the real difference between these three ways of changing from one Activity to another?
These are not 3 ways to "change Activity". They are forms of implement onClick @Ramaral Considering what Ramaral said, I will explain below ways to implement the onClick, according to your doubt:…
-
2
votes1
answer3536
viewsQ: Alert auto close using Bootstrap
Using Bootstrap and created a button save in which it performs a specific function selector(). This function will be executed only after saving in the bank, then it will show an alert that will…
-
1
votes1
answer46
viewsA: Error clicking a button to access website
You need to add the http:// in his link. See below how it should look: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://google.com")); startActivity(browserIntent); See more…
-
1
votes2
answers402
viewsA: How to make a span display the value of a range as you move it with your mouse?
You can do it this way: var $range = document.querySelector('input'), $value = document.querySelector('span'); $range.addEventListener('input', function() { $value.textContent = this.value; });…
-
1
votes2
answers446
viewsA: Intent. Filter program that appears in the "open with" option
See how the syntax of <data>: <data android:scheme="string" android:host="string" android:port="string" android:path="string" android:pathPattern="string" android:pathPrefix="string"…
-
3
votes1
answer165
viewsA: Several Imageview defined src in xml, from java.lang.Outofmemoryerror error:
OutOfMemoryError is the most common problem that occurs on Android when dealing with bitmaps. This error is triggered by the Java Virtual Machine (JVM) when an object cannot be allocated due to lack…
-
6
votes3
answers2785
viewsA: How to have a full-screen Webview?
To leave the WebView in fullscreen or fullscreen, in English, first you should define both height and width as math_parent. Soon after there are basically two ways to let the device fill in all…
-
0
votes2
answers1674
viewsA: Android keyboard does not override buttons
One solution is you use the ScrollView. With it you can drag the screen so that you can see hidden elements below the keyboard. It is usually used when you have several views on the same screen. See…
-
4
votes2
answers394
viewsA: Spinner together
There are several ways to do this, however I’ll show you a way using the method setOnItemSelectedListener(). This way, I check if the selected item is the first one using position == 0. In the first…
-
5
votes2
answers3867
viewsA: Add Item to Spinner
Basically there are two ways to add item to Spinner, providing a list with an array of strings defined in a string resource file (string Resource) and programmatically: XML To insert the list in…
-
16
votes2
answers8743
viewsA: What is the difference between __str__ and __repr__?
The __str__ serves to display the object to end user, used by the command print and by function str The __repr__ serves to display the object to the programmer, used by console of Python and the…
-
2
votes1
answer328
viewsA: How do Admob banner fill full width?
The width of AdView varies depending on attribute adSize. You can check these sizes in Announcements of banner. On the other hand, instead of using AdView you can replace with InterstitialAd. The…
-
1
votes1
answer53
viewsA: Manifest Merger failed with Multiple errors
The archive AndroidManifest.xml is the main file of the project, where are all settings. It must be in the project root folder, containing all the necessary settings to run the application, such as…
-
1
votes1
answer351
viewsA: Android Listview customized in a Fragment
The answer is yes. There are several ways you can solve this and if the problem is ListActivity then you can use the ListFragment. See more here in the documentation.…
-
1
votes1
answer1384
viewsA: How to change IMG(logo) from menu(header) when scrolling page?
You can do this way by using $(window).scroll and exchanging the image with .attr. Behold: jQuery("document").ready(function($){ $(window).scroll(function () { if ($(this).scrollTop() > 50) {…
-
6
votes1
answer1371
viewsA: How to uncheck a Checkbox when dialing another?
The ideal is to use RadioButton and RadioGroup, however answering your question by using CheckBox, one of the ways is to do it this way: cb01.setChecked(true); cb01.setOnClickListener(new…
-
1
votes2
answers46
viewsA: Menu error appear slowly
You can use transition: linear 0.2s using jQuery. See below how it would look: jQuery("document").ready(function($){ var nav = $('#nav-main'); $(window).scroll(function () { if ($(this).scrollTop()…
-
2
votes1
answer405
viewsQ: Delete repeated words from an array and sort it
I have a certain function that returns to me array disorderly with several repeated cities. This way: <?php function getArrayCities() { return array("são paulo","rio de janeiro","belo…
-
3
votes1
answer2042
viewsA: Activity not found
You need to put the intent-filter within your activity. Behold: <activity android:name="org.view.activityAcessar"> <intent-filter> <action android:name="android.intent.action.MAIN"…
-
5
votes2
answers101
viewsA: How to get an item from a list randomly?
Whereas it is possible to use the random.choice, on the other hand, if you also want to capture several items randomly, you can use random.sample passing as parameter the list and the number of…
-
3
votes2
answers1205
viewsA: Call Another Layout
Are you putting the layout in place where it is necessary to insert a class. Basically in this your case, you will need to create another Activity, for example ActivityEstado, with his layout…
-
1
votes2
answers656
viewsA: List my app in the list of programs that can open a document
It is necessary to create a IntentFilter, intention filters, in his Activity within the manifest.xml, that will add your app to the specific list. An example, when it is clicked on the share would…
-
1
votes1
answer77
viewsA: Display value from another screen
Declare the String t out of your onCreate(). Behold: private String t; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
1
votes3
answers1031
viewsA: How to insert markers (Marker) into a map in another Fragment?
Considering the minimum details provided in your question, I will try below to show how the basics would be when it comes to Google Maps API. See below for a simple class in which it is marked with…