Questions tagged as 'android'

1
answer

What is the best practice for instantiating a class in Java?

Aiming at performance, how should I instantiate an object (eg a DatabaseHandler) to be used in Fragments. Should I instantiate them in activity and pass via constructor method to Fragments or should I instantiate them in each Fragment?     
asked by 05.09.2016 / 18:10
1
answer

Get android gallery photo directly

I've researched here and elsewhere on the internet, but I could not find anything like that. Is it possible to restrict that the photos selected by a user come only from the gallery? Ex: When I click on a profile photo and choose the gallery opt...
asked by 18.05.2016 / 22:52
2
answers

Call Gmail app from my app. And send email from my app

I have already researched the two functions, but everything I encounter is very vague. I need to send an email from my application, directly to an email account (which is my user's). And my other problem is to call the Gmail application...
asked by 09.12.2015 / 06:45
2
answers

How to change the color of a ListView item while it is being pressed?

By default, when you click an item, it changes color at the time of the click, however I've changed my listView and this click is not working. Does anyone know how to implement it if it is some view-ready method, an animation or some check with...
asked by 12.11.2015 / 19:34
1
answer

How to rescue external IP address on Android?

The IPV4 local address is not too complex to redeem, you can do this by using the NetworkInterface . But in addition to the site, there is also the external IP , where I noticed that some people use some APIs , such as the WhatIsMy...
asked by 26.04.2017 / 02:01
2
answers

Java error when inserting image into worksheet. Apache Poi

I'm trying to insert an image into a sheet using Apache POI, but I'm getting the following error: 03-03 20:21:50.898: E/SELinux(28413): selinux_android_seapp_context_reload: Error reading /seapp_contexts, line 16, name levelFrom, value contain...
asked by 04.03.2016 / 00:57
1
answer

Importing galleria images into the Android app

I am putting together an App in which I want it to allow, through a button, that I choose images from the gallery and include and save within the application. But I have a problem with IMAGE_GALLERY_REQUEST because NetBeans says it can no...
asked by 23.01.2016 / 17:35
1
answer

I can not see the ListView

#importandroid.os.Bundle;importandroid.support.v7.app.AppCompatActivity;importandroid.support.v7.widget.Toolbar;importandroid.view.View;importandroid.widget.Button;publicclassMainActivityextendsAppCompatActivity{@OverrideprotectedvoidonCreate(B...
asked by 22.10.2015 / 01:46
1
answer

How to set a text based on the EditText id and not on the EditText name?

When I set a text in an EditText I do so. EditText edit = new EditText(this); edit.setId(0+4); edit.setText("Meu Texto"); But I presumed to set the text by the id because in my case I have several editText called "edit". They have the same...
asked by 05.08.2015 / 16:08
1
answer

Save output after applying a replace

Hello, I have the following code, but I need to apply a replace to output ( FileOutputStream ) I get via http before saving it. public void DownloadFile(String fileURL, String fileName) { new Thread(new R...
asked by 26.07.2015 / 04:29