Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Hexadecimal number to decimal in Java (Android)

Tags:

java

android

As in the title above. I want take the hex number from an EditText

EditText number = (EditText) findViewById (R.id.etDisplay);
Editable stringEditable = number.getText().toString;
String nuovo = stringEditable.toString();

I want to convert nuovo to a decimal number.

like image 565
br1 Avatar asked May 21 '26 14:05

br1


2 Answers

int i = Integer.parseInt(nuovo, 16);
like image 175
pixel Avatar answered May 23 '26 02:05

pixel


int i = Integer.parseInt(nuovo,16);

like image 27
Will Avatar answered May 23 '26 04:05

Will