Posts by Leonardo Rocha • 859 points
53 posts
-
1
votes1
answer8729
viewsA: Method of closing an Activity
To close an Activity and "return" to the previous one, simply call the method Finish(); Done this on the second Activity, it will close the same and return to previous, in case your Activity…
androidanswered Leonardo Rocha 859 -
0
votes1
answer72
viewsA: Example to interact res/xml/prefs.xml with a.java activity.
To work with Checkbox, in your layout create a Checkbox: <CheckBox android:id="@+id/checkBox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Seu…
-
0
votes2
answers670
viewsA: How to hide the background of images in the android studio app?
Ideal is that the images of your application are in format png (not obligatorily) so that they can behave in the same way in all devices and preferably have a transparent background. You can also…
-
0
votes1
answer405
viewsA: Stop or cancel asynctask
To cancel/stop an Asynctask simply call the method Cancel mt = new MinhaTask(this, progress) ; mt.execute(); // Inicia a task mt.cancel(true); // Cancela a task…
androidanswered Leonardo Rocha 859 -
1
votes2
answers61
viewsA: How to update the background colors of the lines of a listview?
With Adapter you can call the method: adapter.notifyDataSetChanged(); Done this it updates the listview
-
3
votes1
answer6390
viewsA: How to make a login and password screen
You have several ways to do this I will show you how to do using PHP (server side), MYSQL(database) Java(android) and the Volley library. In your Gradle add: Compile…
androidanswered Leonardo Rocha 859 -
0
votes1
answer2876
viewsQ: Instagram API get information about a particular post
Is it possible to access the media (of course public) without having the authorization of the user responsible for it? The idea is to know the number of likes and comments of a particular post via…
-
3
votes1
answer1532
viewsQ: Change caption line Google Charts
I am currently using the Google API (Google Charts) to generate some charts, but I noticed that when there are small percentages, eg: 0.94%, 1.2%, it makes the reading of the "Labels" a little…
-
0
votes1
answer406
viewsA: Circular Progress Bar Android
You can follow this example to create a circular bar: https://stackoverflow.com/questions/27213381/how-to-create-circular-progressbar-in-android Thank you…
-
2
votes1
answer1457
viewsA: How to save locations from a map to an Sqlite database?
Save in the database the coordinates, latitude and longitude as String, so when to query pass the two information as parameter. If this is still not useful, consult this material, I believe it will…
-
-1
votes2
answers7090
viewsA: How to definitely remove a project in Android Studio?
Go to the folder where Android Studio projects are saved, example: C: Work SEU name NOME_DO_PROJETO Inside that folder, delete the project you want and you’re done. So the next time you log into…
-
0
votes1
answer61
viewsA: Android restriction - 3g
You can do it that way: private void setMobileDataEnabled(Context context, boolean enabled) { final ConnectivityManager conman = (ConnectivityManager)…
-
-1
votes2
answers2831
viewsA: How to inflate a button inside a Listview Item?
I hope it helps you, http://androidforbeginners.blogspot.com.br/2010/03/clicking-buttons-in-listview-row.html Thank you…
androidanswered Leonardo Rocha 859 -
-4
votes2
answers619
viewsA: How to capture the pressing of a key with the program running in the background
seuJTextField.addKeyListener(new KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent e) { if(e.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER) { //Aqui é seu código…
javaanswered Leonardo Rocha 859 -
5
votes1
answer3559
viewsQ: Webservice REST Simple
How to create a simple REST-type Webservice that does HTTP communication from an Android device with the server, using the PHP language? My goal is to make Requests and receive as a result Response…
-
0
votes1
answer178
viewsA: Settext error checking internet connection
You are giving error because you did not initialize the object stsRede, so do it this way: EditText stsRede = (EditText)findViewById(R.id.stsRede); // Caso seja um EditText seu objeto stsRede If you…
androidanswered Leonardo Rocha 859 -
1
votes1
answer93
viewsA: Listview is not updating, Android
You can use the following method: list.invalidateViews(); // Para atualizar a lista And to update the content if the invalidateViews() does not work and you have an Adapter:…
-
3
votes3
answers694
viewsA: What best practices when implementing requests?
There are several ways of making requests to Webservices, through code that in the case would become too extensive or through Apis, a very simplified way of making such requests are in these ways:…
-
1
votes1
answer48
viewsA: Add Uitabbarcontroller without storyboard
UITabBar *suaTabBar = [[UITabBar alloc] initWithFrame:CGRectMake(0, 0, 320, 50)]; suaTabBar.delegate=self; [self.view addSubview:suaTabBar];
-
6
votes3
answers12748
viewsQ: Generate random numbers in an Array from 10 to 50
Since I can generate an array of random numbers with a limit, they should be numbers from 10 to 50. To generate random numbers from 0 to 50 I use: Random random = new Random(); int array[] = new…
-
5
votes3
answers4676
viewsA: Is the Finally block always run in Java?
Yes. The Finally block will always run even if it falls in the catch. Take this test: public class Teste { public static void main(String[] args){ try { int a = 0; int b = 0; int res = a/b;…
-
0
votes2
answers37
viewsA: How to change the color of an item or of the entire Backgroud of a listView by onActivityResult?
Change the color of the list: ListView lV = null; lV = getListView(); lV = (ListView) findViewById(R.id.mylist); // Nome da sua listView lV.setBackgroundColor(Color.WHITE); // SUA COR Change the…
androidanswered Leonardo Rocha 859 -
4
votes1
answer1724
viewsA: What is Recyclerview on Android?
RecyclerView has come to replace both the ListView as to the GridView (including entities supporting both). The RecyclerView is much more efficient than the two old implementations, even using a…
-
0
votes1
answer137
viewsA: Cardview in API 10
You need to set the divisor to 0, so that you don’t have this line at the bottom of each cardView, this can be used both to assemble a list with the "cards" as well as individually. <ListView…
-
0
votes3
answers1384
viewsA: Turn Audio & Video into Base64
For video you can use: videodata = Base64.encodeToString(objByteArrayOS.toByteArray(), Base64.DEFAULT); For audio you can use: File file = new File(Environment.getExternalStorageDirectory() +…
-
0
votes3
answers931
viewsA: Images getImageUrl()
You can download the background images so that the user doesn’t have to wait for the image to be downloaded and then just load them using the url or the cache system. Here is an article on the…
androidanswered Leonardo Rocha 859 -
0
votes2
answers2331
viewsA: Edit the name of Aplicationid in android Studio
Follow this content from Google, it can help you do this. http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename…
androidanswered Leonardo Rocha 859 -
3
votes1
answer272
viewsA: Updating data from one Active to another
It is possible using a Broadcastreceiver or forcing the content to the other Activity through an Intent.…
-
0
votes1
answer170
viewsA: Get AIMS e-Crew Schedule information?
In the case of the website and mobile application, to obtain specific or supposedly confidential information you need access to an API. On the tapes of these websites/app commented by you, they use…
-
0
votes1
answer45
viewsA: Load array with Parse data
This happens because you did not load again when you entered the new post, give a "refresh" each time you load a screen, to update the data. This is not a cache problem. If you are using a…
-
2
votes2
answers371
viewsQ: Swift Multi Selection Problem Uitableview
I have a tableView that when it is in "Edit" mode I can select each item and take an action, for example remove the selected items. When I select the items, the first ones are left without "Line…
-
-1
votes3
answers132
viewsA: Kill application without root
@Override public void onDestroy() { super.onDestroy() }
androidanswered Leonardo Rocha 859 -
0
votes3
answers1106
viewsA: How to view query result in Sqlite?
Use a cursor to return your QUERY results Example: Cursor c = database.rawQuery("SELECT * FROM nome_da_tabela", null); c.moveToFirst(); With this you can use the "c" to return your results.…
-
1
votes1
answer120
viewsA: How do you put Admob ads on Genexus?
You need to register on the adMob website, and sign in with your developer Google account, then just follow these steps:…
-
-1
votes3
answers132
viewsA: Kill application without root
You can use to destroy: Finish(); Use this method to "kill" the root-less application.
androidanswered Leonardo Rocha 859 -
-1
votes5
answers169
viewsA: What is the fastest is_null($y) or $y == null?
$y == null. In terms of performance it is not so relevant the difference, but if used frequently, really worth it just use it.
phpanswered Leonardo Rocha 859 -
2
votes0
answers54
viewsQ: Update Main via an Intentservice
I have an application that works together with GCM (Google Cloud Messages), which consults the server and when there is news sends a notification to the user. I need to update my Mainactivity…
-
-1
votes2
answers84
viewsA: Stackoverflowerror when calling a class
As in your mainactivity you "extends" of Actionbaractivty you need to implement the method onCreate @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //…
-
4
votes1
answer222
viewsQ: Android notification
I have a very simple project to test that at the event onCreate from screen 1 sends a notification, which by clicking opens screen 2. Purposely, I quickly click on the notification to open the new…
-
1
votes2
answers680
viewsA: Real time update on Android apps
You can work with the Services concept, which executes requests to the server to check from time to time if there is something new and update your application or send a notification to the user. Or…
-
3
votes1
answer184
viewsQ: Asynctask Android
I have a "Runnable" method that executes in a new Thread a certain method to update my list. Every time I call this "Runnable", I’m creating a new Thread, which for me is not very positive... How…
-
0
votes2
answers837
viewsA: Android Progressdialog does not appear
Your code is right, make sure it’s going through that stretch: //--------------PRE EXECUTE--------------------------------------// @Override protected void onPreExecute() { super.onPreExecute();…
-
0
votes1
answer403
viewsQ: Fatal error: unexpectedly found nil while unwrapping an Optional value
I got the following error message: Fatal error: unexpectedly found nil while unwrapping an Optional value In the following code snippet: // Lê uma coluna do tipo String no (BANCO DE DADOS) func…
-
1
votes2
answers83
viewsQ: Why is there a 'Nsinvalidargumentexception' in this code?
I have a class that manages all my database, my project is in Swift but I have two classes in Objective-C to make the "bridge" between the classes and my Helper. After some testing in iOS simulator…
-
2
votes1
answer174
viewsQ: How do I open a Viewcontroller via Local Notification?
I have an application that sends notifications to the user from time to time, but how do I open a View without being the main View, when the user clicks on the notification? Example, Whatsapp…
-
3
votes1
answer250
viewsQ: Execute a method with the closed application "Service"
On Android it is possible to send notifications, make queries via http, execute methods, all through a Service without the user need to necessarily run the application, just the fact that the…
-
1
votes1
answer54
viewsA: Does anyone know how to put "UTF-8" and "Scrollview" on Android via Java code?
You can use the native methods in Android Studio to insert the HTML codes within the available methods. http://developer.android.com/reference/android/text/Html.html?…
androidanswered Leonardo Rocha 859 -
0
votes1
answer36
viewsA: Error inserting Slider inside View - Swift
Remove the Cluster View, leave only the Main View and place the objects inside.
-
3
votes2
answers111
viewsQ: Thread in the background when the app is closed
How do I run a Thread with the application closed? That is, so that when the user turns on the device it starts without having to enter the application.
-
1
votes0
answers99
viewsQ: "Outofmemoryerror" error using Volley
I’m making an application where I have a URL that returns a JSON, through the Volley library, I’m taking the content of this URL and turning into string, this process shall be carried out on each 5…