Questions tagged as 'android'

1
answer

Toast Message At the heart of Android's activity

I'm creating an application and want to put a message using Toast. But when creating the toast the same is only at the bottom of the activity. To centralize the message I tried to use this command line. Toast.makeText(MainActivity.this, "Taref...
asked by 03.10.2018 / 18:29
1
answer

Application closing in user interaction after being summarized

I'm playing around with an application that controls my mobile's flash , but it does force close as soon as the user interacts with the app after it has been summarized . For example: I opened the application Turn the flashlight on a...
asked by 22.04.2014 / 20:53
3
answers

Pass value to a function in java

Hello! in Javascript to pass a value to the function I do: <button onclick="myFunction('valor')">Click me</button> and redemption like this: function myFunction(a){alert(a);} And in java on android, how do I do?     
asked by 10.05.2014 / 01:50
2
answers

NullPointerException when creating a View on Android

I'm creating a Activity on Android, whose code is here , and I'm getting a NullPointerException near the line final TextView txtResult = new TextView(this); I got the following stack dump: 05-07 09:12:57.180: E/AndroidRunti...
asked by 07.05.2014 / 15:44
1
answer

Error trying to execute firebase forgot-password

I'm doing the firebase's forgot password screen and it's giving an error when I put the .sendPasswordResetEmail. This is the version of my firebase: implementation 'com.google.firebase:firebase-core:11.8.0' implementation 'com.google.fireba...
asked by 28.11.2018 / 19:36
1
answer

Pass an image from an activity to main screen

How can I move an image from an activity to another actiivity? I have an image on my settings screen, I want to send it to my home screen. I saved it in my sharedPreferences and would like to use the key on my other screen, just like I do...
asked by 29.11.2018 / 14:06
1
answer

Android - How to detect which fragment is current?

Hello, I have an application that uses the fragments system and a FloatActionButton, in one of the fragments I have an ad banner just below the FloatActionButton, I did the form below but it does not work with the fragments on the stack, is there...
asked by 26.09.2018 / 12:56
1
answer

Read text file via HTTP

I'm creating an Android app with Android Studio and am having trouble reading a text file that is hosted on the Internet. Whenever I try to execute the checkVersion () method it returns the following error: Themessageisemptybecausenet.getMe...
asked by 09.03.2014 / 02:01
2
answers

The method openOrCreateDatabase (String, int, null) is undefined for the type DatabaseData

I'm having trouble creating a class that created and manipulated the database! But in criar() method gave a problem saying that    "The method openOrCreateDatabase (String, int, null) is undefined for   the type DatabaseData ". Doe...
asked by 03.03.2014 / 19:01
1
answer

How do I delay or cause a wait on Android?

I have a for where it scans a String vector, sending command increment increment. for(int i=0; i < msg.size(); i++) { enviarComando(msg.get(i)); } When he sends, I want him to wait 1 second for each shipment. I tri...
asked by 25.08.2018 / 18:57