Most voted "android" questions
Android is an operating system for mobile devices developed by Google and the Open Handset Alliance. Use this tag to reference questions related to programming for Android and be relevant only to this operating system. Use the [android-subject] tag instead of [subject] alone.
Learn more…8,935 questions
Sort by count of
-
1
votes1
answer132
viewsHow to initialize the components of a layout in the onCreate of a Fragment?
I created a Fragment to show a list of items, but I need to initialize two components a listview and a Progressbar on onCreate but I don’t have the reference of the layout file they are. How do I…
-
1
votes1
answer1401
viewsDelete text in Edittext field
How do I delete a text after sending. enviar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String value = editText.getText().toString(); //push creates a…
-
1
votes1
answer161
viewsViewholder Pattern in an Activity
Let’s assume that I have an Activity with its layout and, using the Butterknife and the Viewholder Pattern, I create a nested class in which I pass the View root and inject the Butterknife in it.…
-
1
votes1
answer58
viewsError in Parceler lib annotation
I’m implementing a class that implements Parcelable and I’m using the lib Parceler, but when I run the application appears the following error: Error:Execution failed for task…
androidasked 6 years, 10 months ago Janaina de Paula 51 -
1
votes1
answer81
viewsReference main class variable, in a @Override
We can reference a variable of the main class, for example within the method onCreate of the two forms (with or without the this): public class NovoRegistro extends AppCompatActivity { TextView…
-
1
votes1
answer657
viewsreturn function json object
i have an android function that connects to the server and returns me a json, that json and stored in a variable called object. however I have to make this object go to another screen via Return but…
-
1
votes1
answer237
viewsWhy inflate a Layout in Fragments instead of setting one already ready? Ex: setContentView(R.layout.activity_example)
I’m learning about Android and would like to better understand how this part of the system works. Instead of inflating a layout, it would not be simpler to do as when creating an Activity, for…
java android android-layout android-fragment android-activityasked 6 years, 10 months ago Nakamoto 1,341 -
1
votes1
answer42
viewsHow to get other values from the selected Spinner item than shown?
Doubt: How do I find the value of the field handle concerning the nome that was selected in the Spinner ? Setting: Table clientes Campos _id, handle, nome The ArrayList of Spinner is established as…
-
1
votes1
answer163
viewsCreate a Spinner from a fixed list with more than 1 field
How do I add the values in this Spinner ? I need to create a Spinner containing 2 "fields" (Cod, option). Default values will be added, but later the codes cannot be changed, so I need the field cod…
-
1
votes1
answer27
viewsButtons of a Linearlayout are getting giant
I want to adjust the buttons so that they are underneath each other, but when I try to put, they are wide and not like a normal button. See: The xml is like this: <?xml version="1.0"…
-
1
votes0
answers274
viewsCapture photo sequence and save automatically on Android
I am trying to use my android camera in an application so that when taking the first photo I am not redirected to the home screen. Currently the application is as follows: When clicking on "Take…
-
1
votes2
answers89
viewsStandard value in Spinner+ generated from the database
I have a spinner that pulls the bank values, but I would like to leave it with nothing selected or default value: public void spinnerClientes() { ControllerClientes ctClientes = new…
-
1
votes3
answers370
viewsListview with different layouts per line, according to filtered value
I have a unique table in BD, which contains the records with fields like: tipo, data, hora, cliente, historico According to the value of tipo, the field cliente is or is not mandatory, that is to…
-
1
votes1
answer61
viewsCalling more than one callback at the same time
I need a Workerclass that generates sequential numbers to print through a Callback interface these numbers in Mainactivity and a Segundaactivity when opened. My problem is that when Segundaactivity…
-
1
votes0
answers42
views -
1
votes1
answer53
viewsCheck if current time is within the radius set in the database
I wanted to know how to see if the current system time is within a previously defined radius I currently have this code, but it always returns "Closed at the moment" Calendar calendar =…
-
1
votes0
answers23
viewsAxway Titanium - Error when compiling when adding a library to use with Hyperloop
I’m trying to integrate an Android library to Hyperloop to use in my radio application developed in Titanium, but when it is added to the project error occurs at the end of the compilation. [INFO] :…
-
1
votes1
answer174
viewsHow to use Appcompatactivity functions within a Fragment?
I have an Fragment and need within it some Appcompatactivity functions, as I implement both in the same class? It’s like this: public class clientes extends Fragment { I’ve tried to: public class…
-
1
votes1
answer128
viewsMy BD search placed in a listview (Arrayadapter) returns the object address and not the content
I made an APP that saves the date and a series of numbers (8 numbers) in the Android database. I created an object ( with date and numbers), but when I search all objects inside the database and put…
-
1
votes1
answer73
viewsHow to check if there was an error in the POST
I need to check if there was any error in the reply of onPostExecute or gave time out on the server, because sometimes it gives some error in the process and this method does not even start, as I…
-
1
votes0
answers122
viewsCollapsingtoolbarlayout equal to Nubank
Hello, I would like to know how to make the design of Collapsingtoolbarlayout the same as Nubank. The one below: The code below is what I tried to do, but it does not work collapse properly.…
-
1
votes1
answer255
viewsChanging the back button
I’m trying to change this back boot. Here on the forum I found this code <item name="android:homeAsUpIndicator">@drawable/back</item> <!-- Icone de voltar --> But it stayed that…
androidasked 6 years, 9 months ago Alberto Bezerra 27 -
1
votes1
answer130
viewsAsynctask task execution timeout
How do I limit the running time of a Asynctask and return a warning when the limit is reached ? The method searches a json of a webservice, but the same may be out of the air, and when this happens…
-
1
votes1
answer101
viewsHow to create a hamburger menu with a Mainpage inheriting from Tabbedpage?
I’m having a hard time creating a menu hamburger because my MainPage inherits from TabbedPage. There is a way to do this with a TabbedPage? To create this menu, we usually create two new…
-
1
votes1
answer562
viewsWait for the results of asynchronous Firebase methods
I am frequently having problems in various code snippets where I need to call asynchronous methods from the Firebase Database library. The issue is that these methods often do not return their…
-
1
votes2
answers125
viewsGoogle Maps returning Latitude and Longitude as zero and problems when placing the Marker
I’m trying to use Google Maps, and settar a location in it (pulling the user’s Latitude and Longitude). It pulls and displays on a Toast, but it does not Setta this in the onMapReady method and not…
android google-maps android-fragment google-maps-android-api-2asked 6 years, 9 months ago Wallace Baldenebre 114 -
1
votes0
answers185
viewsAndroid app with colorful background on buttons and text
I’ve been playing with an android app, and I don’t know how it started to give problems...it didn’t start at all, as soon as the message appeared saying that the app crashed and if it wanted to…
-
1
votes2
answers2112
viewsMascara for money on android
I am creating a function for when the user type in a EditText , he returns me with a masca in the field, Example: Typing 1 returns "R$ 0.01" When typing 11 returns "R$ 0.11" and so on and so forth I…
-
1
votes1
answer104
viewsPull back from Asynctask class
I have a class Main that performs a method receberSolicitantes() with a task in background. While it is executed, it updates a progressBar. Everything is working perfectly with the method as…
-
1
votes2
answers102
viewsHow to use the Sharedpreferencesutils.java class?
Sorry about the title, I don’t know how else would be a better way to ask. I’m learning to code on android apps, and I found a JAVA class to facilitate the use of Sharedpreferences. But I don’t…
-
1
votes1
answer495
viewsAndroid Studio set a string in various textview
I am studying the Android Studio and I ended up facing a problem, and I needed a light. I made several textView on the screen of my application and when I press a button I would change the content…
-
1
votes1
answer209
viewsExport Sqlite Android Database
I need to export my database Sqlite to a folder on the device on which it will be installed, and every time I open the application, the file ". bd" be updated so that at the end of the month I can…
-
1
votes2
answers1711
viewsRequired field, fill in before saving
I’m trying to validate the fields so it’s mandatory before saving the data. Follows the code protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
1
votes1
answer123
viewsChanging the xml by java
I was wondering if there’s a way I could change the layout="@layout/app_bar_main" of <include> by java <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout…
-
1
votes1
answer43
viewsTaking an attribute from a Class
My class asks for a context as a parameter (for example: MainActivity). I can leave without the context? just passing the query as parameter... Is this way: public HttpTask(Context context, String…
-
1
votes1
answer566
viewsAccess a JSON key
I am making a POST request for my Webservice and am getting as a result a Json, I would like to pick a specific field of Json, because the key names are fixed ex: "campo1, campo2,campo3"... and so…
-
1
votes1
answer131
viewsAlarmmanager is not repeating
I have an alarm that is triggered every 5 minutes, and it calls an intentService to test a condition that if true, sends notification to the user, otherwise he does nothing. But the intentService is…
-
1
votes1
answer99
viewsHow to capture exceptions released by the Insert() method?
I am using Sqlite for a local bank in an Android application, my problem is that I am unable to handle the integrity restriction exceptions. I have a table where the two fields are PK, that is,…
-
1
votes1
answer30
viewsAndroid System Login Error (Maketoast)
I am creating a system Login with json on android but when I will present a message by maketoast it gives an error: Process: Imm.pt.videoclub, PID: 11853 java.lang.Runtimeexception: Can’t create…
androidasked 6 years, 8 months ago Tomás Dinis 25 -
1
votes1
answer40
viewsError placing Imagebuttons with sounds inside Ragment
I’m trying to put Imagebuttons playing sounds inside a Fragment called Tab1, but I’m finding two errors: Non-static method 'findViewById(int)' cannot be referenced from a Static context on the line…
-
1
votes1
answer418
viewsFrom Json Object to Listview
Good afternoon to all, I have two classes, the bemVindo and the one that receives data in json and stores in an object and after the json data is received the class sends to the bemVindothe data…
-
1
votes1
answer320
viewsWhy pass arguments to a Fragment using Bundle instead of a set method
I recently asked myself a question, seemingly simple, that I could not answer and I did not find any concise answer. The question is simple: Why use Bundle instead of a set method to pass parameters…
-
1
votes1
answer202
viewsMy app stops in release mode. How to fix?
I’m developing an app with Android Studio version 3.0 Canary, but I’m going through a boring problem. Got like Activity initial with login through the Facebook. I’ve managed the key release to…
-
1
votes1
answer1120
viewsHow to put the 3 buttons at the bottom of the screen?
I want to put 2 buttons at the bottom and 1 button on the 2 buttons. Something like that: (but with the image upside down) These 2 buttons below and a button above 2 and all these 3 buttons should…
-
1
votes2
answers649
viewsCordova can’t outrun "Android target: not installed"
I’m trying to use Cordova for the first time. I’ve seen the directories the Androidmanifest.xml file and the project.properties file No Android Studio já instalar os SDK Android para as plataformas…
-
1
votes1
answer72
viewswant to set the photo in the imageview
I am new in programming and I’m having difficulty setting the photo in imageview, being that already takes photo and saved in the gallery, but is not setting. public void usarCamera() { File…
-
1
votes1
answer78
viewsWorking Volley Android Error
I’m creating an application for Android that sends via Volley some strings. I would like to know how I work errors, for example, if the server is offline. Follow the code for sending strings:…
-
1
votes0
answers50
viewsHow do I share data across multiple apps?
I have apps A, B, C and D and I need to share data from these apps, for a specific app (And) (Basically login data, to log in automatically. As Messenger does, retrieving access data from Facebook).…
-
1
votes0
answers673
viewsHow to use a Figma layout in Android Studio?
I have a project in Figma with some screens, for example the image below: Figma generates the XML or SVG code of each component, such as the "screen": <!-- layout/*.xml --> <RelativeLayout…
-
1
votes0
answers100
viewsInsert additional data into Firebase
I am developing an app that is composed of 3 fragments of registration, here given the example of A, B, C, and B and C is dependent on A. What is the best way to enter the completed data in B and C…