title: Making a simple counter that increments every second on android. What wrong am I doing?
body: <p>Im writing code to display a counter that increments by 1 every second.   </p>
  
  <p>The app is getting forced closed before running with the error - </p>
  
  <p><strong>thread exiting with uncaught exception</strong>  and  <strong>No package identifier when getting value for resource number</strong></p>
  
  <pre><code> public class MainActivity extends Activity {
  
      Handler hand = new Handler();
      TextView ti;
      int i =0;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          ti = (TextView) findViewById(R.id.textView);
  
          hand.postDelayed(run, 1000);
      }
  
      Runnable run = new Runnable() {
          @Override
          public void run() {
             i++;
             ti.setText(i);
          }
      };
  }
  </code></pre>
  
  <p>What wrong am I doing ?</p>