Posts by viana • 27,141 points
761 posts
-
0
votes1
answer302
viewsA: How to make a Scrollview with multiple Components?
In this question about Layout does not fit on the screen after rotation has an answer that can solve your problem. Basically one should use the ScrollView this way below. See: <ScrollView ... ...…
-
2
votes1
answer25
viewsA: App does not go through login
The problem is in your logic. At first you need to check if you are different from "logged in". For example: !this.isLoggedin(). See below: if(!this.isLoggedin()){ console.log('you are not logged…
-
4
votes1
answer252
viewsA: Button that sends email to contact the developer
You can create a Intent and insert into the method setOnClickListener() button. See comments. See an example: Button btnSendEmail = (Button) findViewById(R.id.btnSendEmail);…
-
3
votes1
answer2149
viewsQ: What is the difference between type and dtype?
Based on a previous question, vi that it is possible to identify a variable using type. For example: print(type(3.1415).__name__) #retorno >> float Doing some research, I saw that there is…
-
3
votes2
answers327
viewsQ: Identify if the value being printed is float, string or int
In python it is possible to make an impression of several types of variables using the print. Take an example: print(3.4, "hello", 45); Or individually. print(3.4); print("hello"); print(45); How is…
-
1
votes1
answer812
viewsQ: Check if there is a file inside a specific directory
I have several files inside a directory called imagex, about 5,000 images. A simple example of a file: file_path = "C:/imagex/jonsnow.png" How to step check, efficiently, if there is a specific…
-
1
votes1
answer95
viewsA: How to get data from this Json?
Simple! First you need to import the following libs, in which it is necessary to work with the classes JSONArray, JSONObject and JSONException, for exceptions treatment. See below: import…
-
5
votes2
answers19503
viewsA: What is foreground and background on Android?
Summary In general, the App in foreground is that you see open on the mobile screen. Any and all kind of action/function in the foreground is finalized when you close the App. Already in background…
-
2
votes1
answer270
viewsA: Error while using Adrequest
After the creation of an account at Admob, see below a brief and functional form to create banners news in your application and make a comparison with your code. build.Gradle: Check first the latest…
-
4
votes1
answer53
viewsA: All Admob needs is an XML code?
NAY. You need to make a request to retrieve the ad, which is only possible through a class. See an example: // fazendo uma requisição AdRequest adRequest = new AdRequest.Builder().build(); //…
-
0
votes1
answer1233
viewsA: How to use Elevation?
The attribute elevation will only have any effect if you are using API level 21 or higher. Here are some tips on Elevation & Shadows. According to the specifications of Material Design, each…
-
2
votes2
answers755
viewsA: How to make a button or a checkbox become inaccessible in android studio?
To disable a CheckBox so that it cannot be clicked, the attribute is used enabled, being him false for disabled or true for enabled. See below examples: XML <CheckBox android:id="@+id/checkbox"…
-
2
votes1
answer776
viewsA: How to view HTML elements in an Android Textview?
[...]I wonder what would be the best way to print that[...] The better way, this goes of its necessity. There is no problem in defining an HTML text within your TextView. It would be basically like…
-
7
votes2
answers4807
viewsA: How to use gradient in any component of Android?
XML provides the tag <gradient> in which it is possible to accomplish this feat. Basically you define an initial color, a central color (not mandatory) and a final color to accomplish such…
-
0
votes1
answer531
viewsA: How to create a textView by code in a specific Activity location?
To accomplish this feat is using the Relativelayout.Layoutparams, passing the method getLayoutParams() in view desired. Below follows an example using a simple button: Jon Snow. See comments. View:…
-
7
votes1
answer250
viewsA: Is it possible to call a method when the application is closed?
One option is to explore your own life cycle of its main activity. For example, when the "Erase All" device feature is used, in this case the main activity of your application will call the method…
-
2
votes1
answer464
viewsA: How to change the color of a Hyperlink in android studio?
To change the default color of the hyperlink in a TextView the attribute is used android:textColorLink. You can set the color based on the default color format: #rgb, #argb, #rrggbb or #aarrggbb.…
-
5
votes1
answer55
viewsA: Pass array to a php method
Sometimes it is simpler than we think. Instead of you already pass as parameter the $_FILES["FotoProduto"]["name"], simply pass the $_FILES["FotoProduto"] and in the foreach you can use the ["name"]…
-
4
votes3
answers36730
viewsA: Error pushing origin master on github
If you want to perform this procedure using HTTPS, follow the steps below: $ git init : Do this already inside the desired directory $ git remote add -f origin…
-
3
votes1
answer262
viewsA: Save image from API to mobile memory
This may be happening because you somehow did not grant permission to write on the device. See how your AndroidManifest.xml: <manifest> <uses-permission…
-
3
votes1
answer96
viewsA: How to correctly position a piece of the View created in java?
This definition of FrameLayout in XML, example: <FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right"/> Is equivalent to…
-
2
votes1
answer180
viewsA: How to create getter from Local Date variable?
You can define the getData_entrada() thus below: public LocalDate getData_entrada() { return LocalDate.now(); } View static methods of the public class LocalDate to obtain the current time: now():…
-
1
votes1
answer422
viewsA: When is/was Absolutelayout used?
The Absolutelayout, as you started to mention, allows you to specify the exact location of your children. The location of views can be specified using attributes layout x and layout y both values…
android-layoutanswered viana 27,141 -
0
votes2
answers96
viewsQ: How to check if last item was registered today?
I have a following table: +----+-----------------------+-----------------------+ | id | description | created_at | +----+-----------------------+-----------------------+ | 5 | Game Of Thrones |…
-
2
votes3
answers181
viewsA: How do I use the new Java 8 Date API?
To enable the language features of Java 8 and Jack for your project, insert the following code below into the archive build.gradle level of the module. The sourceCompatibility and…
-
2
votes2
answers606
viewsA: How to remove all files from a folder?
You must use the method removeRecursively(). For example: $cordovaFile.removeRecursively('/storage/sdcard/meudiretorio', "") .then(function (success) { // apagou com sucesso }, function (error) { //…
-
0
votes1
answer4092
viewsQ: When should I use each log level in Android Studio?
There are different levels of log in Android Studio, which maybe, I say maybe, is not much different in other IDE’s. Basically it’s the different ways I can record a message on logcat. The guys are…
-
14
votes1
answer5228
viewsQ: What are the differences between overrideing and overloading in Java?
What are the main differences between overrideing and overloading in Java? What is the relationship between these terms and Polymorphism?
-
2
votes1
answer164
viewsQ: Notification remains in status bar even after click
I have an application where I receive daily notifications, however by clicking on this notification, it still stays on my bar status. I’m using the class Notificationcompat for the creation of these…
-
1
votes1
answer939
viewsA: How does Date Picker and Time Picker work in android Studio?
Android provides some controls to choose a specific time or even date as ready-to-use dialog boxes. Each selector provides controls to select each part of the time (hour, minute, AM / PM) or date…
-
3
votes1
answer1250
viewsQ: What does the "|=" operator mean? (with pipeline and no exclamation)
I was doing some research and came across the operator in sequence |=. Look at: mBuilder.getNotification().flags |= Notification.FLAG_AUTO_CANCEL; There is this operator in JAVA, but I do not know…
-
6
votes1
answer3326
viewsA: How to create custom transitions in Android Studio?
To create custom animations between screen transitions in the application, you can use the method overridePendingTransition() of its public class Activity. Its syntax is: public void…
-
7
votes1
answer1549
viewsQ: Daily notifications at a specific user-defined time
I created a method to send a notification to the user with the name sendNotification() using NotificationCompat.Builder and NotificationManager. I need this notification launched every day at…
-
6
votes2
answers1113
viewsQ: How to return the most appearing words in a column?
I have this table below which has two columns, being id and description: CREATE TABLE myBigTable ( id INT(11) AUTO_INCREMENT PRIMARY KEY, description TEXT NOT NULL ) After entering some records, I…
-
8
votes1
answer1144
viewsA: How do I change the color of the bar status icons in Material Design
Just you define how true the property windowLightStatusBar in the style inside the file styles.xml. This way, icons will be changed to gray (no custom colors). See: <item…
-
2
votes1
answer518
viewsA: Cordova, how to change the color of the control bar: back, home and windows
Bearing in mind that the Apache Cordova transforms HTML5 + CSS + Javascript into native code, you will have to make an adaptation of the basic original code to change the color of the…
-
6
votes3
answers160
viewsA: Check if you have more than one character in a String
There are many ways to do this: Using Apache Commons: String text = "@Teste @Teste"; int apache = StringUtils.countMatches(text, "@"); System.out.println("apache = " + apache); Using Replace: int…
-
1
votes1
answer293
viewsQ: What is a hypothetical programming language?
In a short excerpt from a contest question, he mentioned about various forms of representation of algorithms and about the language of hypothetical programming. What would be the definition of a…
-
1
votes2
answers164
viewsQ: Quivalent method to array_diff() in JAVA
In PHP there is the method array_diff() which verifies values of two arrays and returns the items referring to the difference between them. For example: $arrExclusion = array('as', 'coisas',…
-
4
votes4
answers135
viewsQ: Remove items an array containing only 1 character
I have a following array: $arr = array('estrela', 'não', 'é', 'up','.','Evitem', 'estrelar', 'abobrinha', 'coisa', 'fugaz', 'de', 'interesse', 'praticamente', 'individual', 'conversa mole','.','Só',…
-
4
votes3
answers292
viewsQ: Remove only numeric elements from an array
I have a array in this way: $arr = array('prolongar-se', 'durante, 4, 'a', 7, 'dias', 'dependendo', 'da', 'dose', 'administrada', 'e', 'do', 'pH', 'da', 'água', 'sendo', 7.5, 'ml',…
-
3
votes3
answers701
viewsQ: Make a search independent of the order of the keywords
I have a database in which I need to do a search based on the keywords, regardless of the order. See the complete table below: +----+-----------------------+ | id | description |…
-
1
votes1
answer1589
viewsQ: Redeem values with equal class names using Selenium
I have a situation where I need to rescue values from a array of article's, however I’m not trying very successfully. My HTML is this way: <section class="list"> <article class="card">…
-
1
votes1
answer78
viewsA: Why does this FAB disappear, but not reappear?
The established logic to your FABScrollBehavior is correct. It should stay the way you set it. But by running some tests here, I found a possible bug between versions of Google support libraries.…
-
0
votes1
answer40
views -
1
votes1
answer771
viewsA: Picasso cache of images
It is possible to resolve this impasse using the class Cache, passing it to the builder of OkHttpClient. Simply like this below: int cacheSize = 10 * 1024 * 1024; // 10 MiB Cache cache = new…
-
1
votes1
answer19
viewsA: Problem with Menupop
I don’t see any problem with the click in the item in relation to the PopupMenu. Use the context in which the view is being shown. Then you can modify your Intent inserting the mContext in this way:…
-
2
votes2
answers661
viewsA: Database - Sqlite
If you are developing an application using the framework React Native and want to persist data using Sqlite directly, perhaps, I say perhaps, not so interesting as it has to explore native features…
-
0
votes1
answer108
viewsQ: Parallelism with Angular 2
I need to insert 30,000 records into the device (in Sqlite) through a file. But at the time of insertion, the application hangs. So I thought about creating an asynchronous service, but I don’t know…
-
1
votes2
answers250
viewsA: Two Layouts.xml for the same Fragment, is it possible?
An alternative is to use the include to include another layout in his FrameLayout. The logic is this, you leave one layout hidden and the other the view. From this form, the moment you click the…