Questions tagged as 'java'

1
answer

Android 6.0 - Permissions to send Text Messages (send SMS)

Hello, I am trying to send text messages from my app and using a physical device with Android 6.0 (Moto G 3rd generation), this is the code I use: SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage("12345678" , null,"hello world" ,...
asked by 26.04.2016 / 01:54
1
answer

Doubt with operator '=' several times in a statement

I would like to know why this code prints 3,1 and not another value: Point a,b,c; b = new Point(2,4); a = new Point(3,1); c = b = a; c = new Point(1,2); System.out.println(a);     
asked by 05.09.2016 / 05:20
7
answers

What is try .. finally used for without the catch clause?

I maintain an inherited system, and I have seen in many parts a block similar to the following: try { // aqui codigo } finally { // mas codigo aqui } My question is: What is the function of making a try .. finally , without the b...
asked by 12.02.2016 / 18:30
4
answers

Create a "hidden" class only accessible from another

I am creating an API and I would like the user to only depend on one class, so that he does not have to search through several and be simpler (For this example, I will use the names ClassA and ClassB, ClassA being the public and Class B I want t...
asked by 11.10.2016 / 08:43
1
answer

Use regex to replace all occurrences with CASE_INSENSITIVE (regardless of uppercase and lowercase)

I try to make a method that finds and replaces words using regular expressions. The point is that I must be able to find and replace the word regardless of whether it has uppercase letters or not. This is the code that I carry: public String r...
asked by 09.11.2016 / 02:51
3
answers

Back to parent activity

In manifest.xml I have the following: <activity android:name="ActividadA"> </activity> <activity android:name="ActividadB" android:parentActivityName="ActividadA"> </activity>...
asked by 24.10.2016 / 18:04
3
answers

Voidable types in Java equivalent to those in C #, possible?

The main purpose of this question is to contribute content to Stack Overflow in Spanish In C # we can convert data types (that do not accept the null value) to be nullable; assigning null to this type of data, produces a syntax error since C...
asked by 04.05.2018 / 02:43
3
answers

Java. Error calling a class

In a university assignment I'm having problems trying one of the classes because it will not let me call her. It does not let me use neither Banco.listarDescybuerto(); nor his.listarDescubierto(); public class Banco { Client...
asked by 18.05.2017 / 18:14
3
answers

Create Chron on Android

I'm trying to make a cron run every X time in the system android tag to call a service that I have made. The features of cron that I want to do are the following: run independently if the Application is running or not (partially d...
asked by 27.10.2016 / 10:00
3
answers

Know when the App is launched for the first time on Android

How can you tell if it's the first time the app starts? It would be interesting, in the case that the user updates the application is detected as new or update.     
asked by 27.01.2016 / 21:15