Questions tagged as 'android'

1
answer

How to create a directory and record a txt file in the SD external memory

I'm doing an app in which I'm trying to create the "Download / Datax" directory and write txt files to external SD memory and I'm using this code: File directorioExt = new File( Environment.getExternalStoragePublicDirectory( Environment.DIRECT...
asked by 29.11.2018 / 23:15
2
answers

Variable accessible from the whole app

Is there any way to have a variable and that it can be accessible from the whole app? Not only from the activity that I am in.     
asked by 11.12.2018 / 18:45
1
answer

Amount and not repeated in ArrayList Android

Hi, I have an arraylist with the object prePedido . which is composed with its ID, an IDcliente, an IDproduct and an idRestaurant. What I need is to build another array without repeating the product ID. And if it is repeated just keep i...
asked by 12.12.2018 / 20:36
1
answer

Create JSON with 4 Entities on android (with GSON)

I need to create an array with data that I have in 4 SQLite tables, these 4 tables have their 4 entities with their Getter and Setter methods, the question is to create a JSON using the GSON libraries would have to create an entity with the fiel...
asked by 25.11.2018 / 07:19
1
answer

Error in a List

Family my app closes when it reaches the 2 line of code: private MyDataBase dataBase = new MyDataBase(context); private List<Nota> itemsImportantes =dataBase.getAllDataImportantes(); The LogCat tells me NullPointExeption on that...
asked by 23.11.2018 / 04:07
2
answers

activate vibration in an android fragment

Following the development of an app, I find myself in a fragment with some buttons. I want a vibration to occur when I click, but when I enter it, it says "can not resolve VIBRATOR_SERVICE" .... public class AsientosFragment extends Fragment i...
asked by 21.07.2016 / 17:25
2
answers

Android: Stop the cycle, visualize the result and return to the cycle

I have the following code, as you can see I am permanently cycling the program, this is because I need to be monitoring the changes that occur, I need to see the Toast messages, but as the program never stops me its visualization, try to use Thr...
asked by 25.11.2016 / 02:32
2
answers

In which cases the IMEI of a mobile device is not available?

I have an application that needs to download data, for that the IMEI of the device has been previously registered in the base, the problem has worked well, now that I use a device with API 27 the IMEI returns it to me null. public String getI...
asked by 31.08.2018 / 01:04
2
answers

Color a Google Calendar event

I am creating events in the Google calendar and I want to assign a specific color to the event, but I do not get it, I get the color of the calendar. The code I use is the following, which creates the event perfectly. public static long ad...
asked by 19.09.2016 / 16:36
2
answers

Show results of a RealmResults in a Recyclerview (Android)

I'm trying to create an adapter to display data in a RecyclerView , but that your data provider is using the database system realm.io , that is, populate the RecyclerView from the result RealmResults of a query, list of...
asked by 27.09.2016 / 22:57