title: Null Pointer Exception in my Activity
body: <p>When I call this Activity, a Null Pointer Exception occurs. Why does this happen?</p>
  
  <pre><code>package com.andrd.gps;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.TextView;
  import android.widget.Toast;
  
  public class User_Detail_ListActivity extends Activity{
  TransportData tdata;
  private TextView drivernametxt,agetxt,addresstxt,liecencetxt,contactNotxt,driverTypetxt,truckNotxt,truckPermittxt,truckTypetxt,fromtxt,totxt;
  Button editBtn,deleteBtn,cancelBtn;
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.user_list);
  
  
      drivernametxt = (TextView) findViewById(R.id.nameTextView);
      agetxt=(TextView) findViewById(R.id.ageTextView);
      addresstxt=(TextView) findViewById(R.id.addressTextView);
      liecencetxt=(TextView) findViewById(R.id.licenseNoTextView);
      contactNotxt=(TextView) findViewById(R.id.contactNoTextView);
      driverTypetxt=(TextView) findViewById(R.id.employmetnTypeTextView);
      truckNotxt=(TextView) findViewById(R.id.truckNoTextView);
      truckPermittxt=(TextView) findViewById(R.id.truckPermitTextView);
      truckPermittxt=(TextView) findViewById(R.id.truckTypeTextView);
      fromtxt=(TextView) findViewById(R.id.fromTextView);
      totxt=(TextView) findViewById(R.id.toTextView);
  
      editBtn =(Button) findViewById(R.id.editBtn);
      deleteBtn = (Button) findViewById(R.id.deleteBtn);
      cancelBtn = (Button) findViewById(R.id.cancelBtn);
  
      drivernametxt.setText(getIntent().getExtras().getString("DriverName"));
      agetxt.setText(getIntent().getExtras().getString("Age"));
      addresstxt.setText(getIntent().getExtras().getString("Address"));
      liecencetxt.setText(getIntent().getExtras().getString("LiecenseNo"));
  
      contactNotxt.setText(getIntent().getExtras().getString("ContactNo"));
      driverTypetxt.setText(getIntent().getExtras().getString("DriverType"));
      truckNotxt.setText(getIntent().getExtras().getString("TruckNo"));
      truckPermittxt.setText(getIntent().getExtras().getString("TruckPermit"));
      truckTypetxt.setText(getIntent().getExtras().getString("TruckType"));
      fromtxt.setText(getIntent().getExtras().getString("FromLocation"));
      totxt.setText(getIntent().getExtras().getString("ToLocation"));
  
  
      editBtn.setOnClickListener(new OnClickListener(){
          public void onClick(View v) {
              Intent intent = new Intent(User_Detail_ListActivity.this, EditUserDetailActivity.class);
              intent.putExtra("TruckNo", getIntent().getExtras().getString("TruckNo"));
              startActivity(intent);
          }
  
      });
  
      deleteBtn.setOnClickListener(new OnClickListener(){
          public void onClick(View v) {
              try {
                  tdata.deleteUser(getIntent().getExtras().getString("TruckNo"));
                  finish();
              } catch (Exception e) {
                  Toast.makeText(getApplicationContext(), "database Error", Toast.LENGTH_LONG).show();
              }
  
          }
  
      });
  
      cancelBtn.setOnClickListener(new OnClickListener(){
  
          public void onClick(View v) {
              finish();
          }
  
      });
  }
  }
  </code></pre>