title: Find Null Pointer Exception
body: <p><strong>HomeActivity.java</strong></p>
  
  <pre><code>    @Override
      public void onCreate(Bundle savedInstanceState) {
      setContentView(R.layout.home);
  initialize();
  super.onCreate(savedInstanceState);
  buildLocationService();
  getLocationDetails(fioLocation);
  icHair = (ImageButton) findViewById(R.id.ic_hair);
  icNail = (ImageButton) findViewById(R.id.ic_nail);
  icSpa = (ImageButton) findViewById(R.id.ic_spa);
  icTanning = (ImageButton) findViewById(R.id.ic_tanning);
  setOnClickListenersToIcons();
  }
  private void setOnClickListenersToIcons() {
  icHair.setOnClickListener(new IconClickListener(this, zipCode, locality));
  icNail.setOnClickListener(new IconClickListener(this, zipCode, locality));
  icSpa.setOnClickListener(new IconClickListener(this, zipCode, locality));
  icTanning.setOnClickListener(new IconClickListener(this, zipCode,locality));
  }
  private void getLocationDetails(FioLocation fioLocation) {
  zipCode = fioLocation.getZipcode();
  locality = fioLocation.getArea();
  }
  public static class IconClickListener implements OnClickListener {
  private Context context;
  private String zipCode;
  private String locality;
  public IconClickListener(Context homeActivity, String zip, String loc) {
  context = homeActivity;
  this.zipCode = zip;
  this.locality = loc;
  }
  @Override
  public void onClick(View v) {
  Intent intent = new Intent(context, MainActivity.class);
  intent.putExtra("businessType", v.getContentDescription());
  if (this.zipCode != null) {
  intent.putExtra("zipCode", this.zipCode);
  }
  if (this.locality != null) {
  intent.putExtra("locality", this.locality);
  }
  context.startActivity(intent);
  }
  }
  </code></pre>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>    @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  ic_Hair = (ImageView) findViewById(R.id.ic_hair);
  ic_Nail = (ImageView) findViewById(R.id.ic_nail);
  ic_Spa = (ImageView) findViewById(R.id.ic_spa);
  ic_Tanning = (ImageView) findViewById(R.id.ic_tanning);
  Bundle intentBundle = getIntent().getExtras();
  String  businessType = intentBundle.getString(BUSINESS_TYPE);
  if (businessType != null &amp;&amp; businessType.equals(getString(R.string.hair))) {
  ic_Hair.setVisibility(View.VISIBLE);
  ic_Nail.setVisibility(View.GONE);
  ic_Spa.setVisibility(View.GONE);
  ic_Tanning.setVisibility(View.GONE);
  }
  if (businessType != null &amp;&amp; businessType.equals(getString(R.string.nail))) {
  ic_Hair.setVisibility(View.GONE);
  ic_Nail.setVisibility(View.VISIBLE);
  ic_Spa.setVisibility(View.GONE);
  ic_Tanning.setVisibility(View.GONE);
  }
  if (businessType != null &amp;&amp; businessType.equals(getString(R.string.spa))) {
  ic_Hair.setVisibility(View.GONE);
  ic_Nail.setVisibility(View.GONE);
  ic_Spa.setVisibility(View.VISIBLE);
  ic_Tanning.setVisibility(View.GONE);
  }
  if (businessType != null &amp;&amp; businessType.equals(getString(R.string.tanning))) {
  ic_Hair.setVisibility(View.GONE);
  ic_Nail.setVisibility(View.GONE);
  ic_Spa.setVisibility(View.GONE);
  ic_Tanning.setVisibility(View.VISIBLE);
  }
  zipCode = intentBundle.getString("zipCode");
  locality = intentBundle.getString(LOCALITY);
  setContentView(R.layout.activity_main);
  addressProgress = (ProgressBar) findViewById(R.id.addressProgress);
  locationLable = (TextView) findViewById(R.id.locationLable);
      }
  </code></pre>
  
  <p>In this case I want to avoid a NullPointerException, and I don't know exactly  which object is null.If one image click in the other activity clicked image is display. please help me.</p>