title: android Cannot invoke substring(int, int) on the primitive type long
body: <p>I have textview which will show large numbers and if the number of digits is larger than 5 I want to make the textview show only 4 digits with dots like this(3544...) I tried but I got this error:</p>
  
  <p>android Cannot invoke substring(int, int) on the primitive type long</p>
  
  <p>here is my code:</p>
  
  <pre><code>EditText EditNumber;
  long  theNumber;
  
  String str = EditNumber.getText().toString();
  
  theNumber = Long.parseLong(str );
  
  if( theNumber &gt;5)
  {
  theNumber =  theNumber.substring(0,4)+"..."; // the error in this line.
  textView1.setText(Long.toString(theSide));
  }
  else
  {
  
   textView1.setText(Long.toString(theNumber));
   }
  </code></pre>