0
i can not convert from string to int after pass the variable from another activity in android studio
String nowy=getIntent().getExtras().getString("yearbrith"); int BRITHYEAR=Integer.parseInt(nowy);
1 Answer
+ 1
The problem is Parsing? You must use try and catch
String nowy = getIntent().getExtras().getString("yearbrith");
try{
int BRITHYEAR = Integer.parseInt(nowy);
}catch( NumberFormatException e){
//anything to display
}
Greetings :D