Questions tagged as 'java'

1
answer

Loop of random numbers

Good afternoon, I'm trying to loop my random numbers .... I have two spinner, 1 with a choice of how many random numbers and the other how many times have to appear in a ListView ... My problem is that it generates the amount of random number...
asked by 29.07.2017 / 21:44
3
answers

Upload with ajax and java

I'm doing an image upload with ajax (I already tested it without ajax and it worked). JS: $("#upload").on("submit", function(e) { e.preventDefault(); $.ajax({ url: $("#controller").val(), type: "POST", data: $(this...
asked by 05.07.2017 / 20:06
1
answer

Create an application shortcut in an onLogClickListener?

The code below creates a shortcut on the device's home screen, but by clicking this shortcut, it returns me an error "The app is not installed" How to solve? I would like this mainactivity to be opened with a specific parameter, to trigger an ev...
asked by 05.07.2017 / 22:51
1
answer

how to position the Caret of a JTextField?

I have JTextField where opening and closing parentheses is optional. However, whenever the user opens and does not close a parenthesis, my program gives error, because I use this text field to calculate an arithmetic expression. In ord...
asked by 05.07.2017 / 16:05
1
answer

RecyclerAdapter with different layouts

I would like to know how to use a different layout with the layout below, if I'm in Activity A show Layout 1, if I'm in Activity B show Layout 2, I saw it done with viewType, but I could not understand how the viewType works, if you can explain...
asked by 26.06.2017 / 00:12
1
answer

Problem with decimal percentage of processor - JAVA

Good people, the problem is the following, I developed a code to get the percentage used by my application of the processor cores: private String getCPULoad() { OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOp...
asked by 12.09.2017 / 03:34
1
answer

Check if field contains a date

I have a list of EditText's that are filled with data returned from the database. Some have a common text, for example <EditText android:id="@+id/edittext" android:layout_width="fill_parent" android:layout_height...
asked by 20.06.2017 / 15:10
1
answer

Problem opening a new Activity

I'm having trouble trying to switch from Activity , simply not opening my new Activity . public void Add(View v){ try { FormularioActivity.choise = 0; startActivity(new Intent(RolavelMainActivity.this, Formulari...
asked by 20.06.2017 / 04:04
1
answer

Include file in Java project

I have a code that runs routines inside Linux servers and I access using public keys. When the project is in my pc (development), everything works because in the code I specify the location of the key that is in my machine, but when generating a...
asked by 19.07.2017 / 20:37
1
answer

listDataHeader for a String

I would like to know if it is possible to return my listDataHeader to a string, because in my system.out it returns the value, but I do not know how to pass it to a string ... private void prepareListData() { // // final Intent int...
asked by 11.07.2017 / 14:41