Questions tagged as 'android'

1
answer

how to hide an item in the menu

I created a menu with buttons to save, to go back and to add, and I would like that when I clicked on add it was hidden or that it is disabled. I tried to use MenuItem item = menu.findItem(R.id.my_item); that I saw in this topic...
asked by 02.01.2018 / 20:02
1
answer

To serve ExampleUnitTest and ExampleInstrumentedTest in Android Studio?

Hello, I'm learning to develop on Android and would like to know the usefulness of these files and how Android uses them. I noticed that some applications sometimes do not have these files.     
asked by 10.01.2018 / 16:25
2
answers

Replace part of string with drawable or image

I get the database a string in formarto "text text text ??? text text" and I need to transform the "???" in an image or some character, the ideal would be an image or drawable that I can customize better. From what I've seen, replace only works...
asked by 15.01.2018 / 13:17
2
answers

How to create project installation done in the android studio

I created a project in Andoid Studio, run it on the virtual machine right now, I would now like to "compile" it to install on a real mobile. How do I do this? I create a file and step to the mobile? Do I have to put it on Google Play?     
asked by 13.10.2015 / 01:02
2
answers

How to get information from Satellites via LocationServices

There are app's that show how many satellites your GPS managed to communicate. Here's an example: link I've seen some examples where GpsStatus.Listener is used in LocationManager . But nowadays instead of Locati...
asked by 27.10.2016 / 18:46
1
answer

How do I publish a specific APK for Android versions above $ API?

I have an app in the Play Store that uses the Crosswalk plugin. However, for Android versions of 5.0 upwards, I want to be able to make a build without the plugin of Crosswalk. Just getting the versions below 5.0 with the build that includ...
asked by 14.10.2016 / 03:57
1
answer

How to use RealmObject class

I'm working on an Android project and trying to use the RealmObject class is not recognized even though I import the io.realm.RealmObject package. Is this class no longer available?     
asked by 15.12.2016 / 12:35
1
answer

Pass an int array 2d to another activity

I have this array : int[][] meuArray= new int[5][3]; How do I send this array to another activity? If it was a array 1d just make intent.putExtra("Array", meuArray); to send and the array and do array = getInten...
asked by 09.12.2016 / 21:31
1
answer

How do I restart a service to call oncreate again?

Hey guys, I have a service and I have all his logic in OnCreate. The problem is that I need it to go through the oncreate again when I perform an interaction in my activity. I've tried using stopService(new Intent(this, YourService.clas...
asked by 15.11.2016 / 15:38
1
answer

Error using Lock Screen

I'm trying to block the screen with the following code: protected void onBloquear(View view) { DevicePolicyManager mDPM = null; mDPM.lockNow(); } Source: link But it gives the following error. Caused by: java.lang.NullPointe...
asked by 14.12.2016 / 23:41