+ 1

I need a help visually in android studio pls help me out......

9th Oct 2020, 4:03 AM
DeepesHackeR
DeepesHackeR - avatar
17 Respostas
+ 4
Provide a proper description about your problem.
9th Oct 2020, 4:17 AM
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~ - avatar
+ 2
sir am getting issue while getting sum of 10 digits number in android studio the app crashes when i ask it to add 10 digits but it adds 9 digit properly so thats my issue
9th Oct 2020, 4:20 AM
DeepesHackeR
DeepesHackeR - avatar
+ 2
What type of error it has, can you show your log report. I think it could be Nullpointer error. You need assign your EditText first.
9th Oct 2020, 6:49 AM
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~ - avatar
+ 1
Please Clarify your question and let's find out the error ?
9th Oct 2020, 4:21 AM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 1
Post the code
9th Oct 2020, 4:23 AM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 1
public class SumofDigits { int sum=0; public int sum(long num) { if(num!=0) { sum+=num%10; num/=10; sum(num); } return sum; } } $##this is the class and and using it with main
9th Oct 2020, 4:25 AM
DeepesHackeR
DeepesHackeR - avatar
+ 1
public void Addbtn (){ try { String number = editTextphonenum.getText().toString(); int newnum = new Integer(number).intValue(); long n; SumofDigits sumofDigits = new SumofDigits(); int sc = (int) newnum; n = sc; Toast.makeText(this, "total is"+sumofDigits.sum(sc), Toast.LENGTH_SHORT).show(); }catch (Exception e){ Toast.makeText(this, "please put some value to add", Toast.LENGTH_SHORT).show(); } } #$#$am using that class here
9th Oct 2020, 4:25 AM
DeepesHackeR
DeepesHackeR - avatar
+ 1
No add it to youre code bits
9th Oct 2020, 4:27 AM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 1
the error is pointing here (int newnum = new Integer(number).intValue();)
9th Oct 2020, 4:27 AM
DeepesHackeR
DeepesHackeR - avatar
+ 1
DeepesHackeR could you put the code in the code bits it will be much clearer
9th Oct 2020, 4:28 AM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 1
sir isuue is with android studio
9th Oct 2020, 4:29 AM
DeepesHackeR
DeepesHackeR - avatar
+ 1
see i saved to codebits
9th Oct 2020, 4:30 AM
DeepesHackeR
DeepesHackeR - avatar
+ 1
Ok let me see it
9th Oct 2020, 4:31 AM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 1
Maybe you make it private, I can't find it
9th Oct 2020, 4:32 AM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 1
now u can get it
9th Oct 2020, 4:34 AM
DeepesHackeR
DeepesHackeR - avatar
+ 1
This code only is not valid in Android studio, may be if you have all code could you give me
9th Oct 2020, 4:40 AM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 1
Public class SumofDigis {
9th Oct 2020, 3:32 PM
Indrajit Indrojit