[Solved] Getting a value of int from edittext

I think when you run your program then edit text have no value that means it will return NULL and NULL can’t be a Integer value so you must have to check Condition Like String editTextValue = number.getText().toString(); if(!TextUtils.isEmpty(editTextValue)){ angka = Integer.parseInt(editTextValue); } I hope its work for you. 3 solved Getting a value of … Read more

[Solved] Try/catch statement jumps to end of program [closed]

Try this. public static void main(String[] args) { Robot robot = null; try { robot = new Robot(); } catch (AWTException e) { e.printStackTrace(); } catch (Throwable th) { th.printStackTrace(); } } The problem is almost certainly that some exception other than AWTException is being thrown. (My money, since you’re a self-described noob, is on … Read more

[Solved] Why does my sorting method for Bigdecimal numbers fails to sort?

Well, since you want to use String numbers, you will have to wrap them in quotations, but your sorting can be much more readable. I would suggest the following String[] numbers ={“-100”, “50”, “0”, “56.6”, “90”, “0.12”, “.12”, “02.34”, “000.000”}; List<BigDecimal> decimalList = new ArrayList<>(); for(String s: numbers){ decimalList.add(new BigDecimal(s)); } Collections.sort(decimalList); Collections.reverse(decimalList); // edit … Read more

[Solved] Hard Time figuring out how to use user input in a for loop in Java [duplicate]

Instead of using read(), you should initialize a scanner and use that. This is what it would look like: package grading.on.a.loop.java; import java.util.Scanner; public class GradingOnALoopJava { public static void main(String[] args) { Scanner in = new Scanner(System.in); String[] grades = new String[5]; for(int counter = 0; counter < 5; counter++) { System.out.println(counter * 5 … Read more

[Solved] How to use Apache Kafka to send data from one microservice to other microservice using SpringBoot?

Yes, you can use Apache Kafka to communicate between Microservices. With Spring boot you can Spring Kafka or plain kafka-client API. Well there are various ways to achieve this, and it is totally depends on your use case. You can start with Producer & Consumer API, producer will send records to a topic, and then … Read more

[Solved] Does Java 8 specification allow to use interface reference type variable on objects that don’t use the implements keyword explicitly? [closed]

Does Java 8 specification allow to use interface reference type variable on objects that don’t use the implements keyword explicitly? [closed] solved Does Java 8 specification allow to use interface reference type variable on objects that don’t use the implements keyword explicitly? [closed]

[Solved] What is timerSeekBar in this java code an object or variable?What is findViewById,

The method findViewById returns an instance of the class that is actually used to define that view in your XML file. (Seekbar) is used to cast that view with specific view. You have to cast that(findViewById) to the class that your variable is defined when you use it. So, This is the reason for SeekBar … Read more

[Solved] How to solve this facebook key hash error?

public void generateHashkey(){ try { PackageInfo info = getPackageManager().getPackageInfo(PACKAGE, PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance(“SHA”); md.update(signature.toByteArray()); String s = Base64.encodeToString(md.digest(), Base64.NO_WRAP); Log.e(“HASH KEY “, s); } } catch (PackageManager.NameNotFoundException e) { Log.d(“Name not found”, e.getMessage(), e); } catch (NoSuchAlgorithmException e) { Log.d(“Error”, e.getMessage(), e); } } try to generate the … Read more

[Solved] How to search for specific text?

All you have to do is add escape characters for \ and “, like this… \\ and \”. “Size: 0-0 — 9 otto @ z . t. — fig se REYfAR, S l ‘ WELCOME BACK, ELLEN TEST! ..$FREE $l PICK YOUR \” \” . @lotto POWER ‘ ’-; A . . . . – … Read more

[Solved] Picasso recycle view retrofit 2 in grid view

Change adapter = new DataAdapter(data,context); line to adapter = new DataAdapter(data,YourActivity.this); then, go to the Adapter class, and paste public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private ArrayList<dashboard.Dashboard_info> android; private Activity activity; public DataAdapter(ArrayList<dashboard.Dashboard_info> android,Activity activity) { this.android = android; this.activity = activity; } now use picasso with Picasso.with(activity).load(android.get(i) .getWeek_image()) .resize(250,200) .into(viewHolder.img_android); solved Picasso recycle view … Read more