title: null pointer exception while generating custom toast
body: <p>i am generating a custom toast with different images depending on which button is pressed by the user
  "toastdesign" is the xml layout file which contains the design of toast.
   but the app crashes when i click on any of the textview and the log cat generates null pointer exception. plz help????</p>
  
  <pre><code>    public void onClick(View v) {
      // TODO Auto-generated method stub
  
      if (v.getId() == R.id.tv1) {
          image = BitmapFactory.decodeResource(getResources(),
                  R.drawable.ic_launcher);
      }
  
      else if (v.getId() == R.id.tv2) {
          image = BitmapFactory
                  .decodeResource(getResources(), R.drawable.edc);
      }
      iv.setImageBitmap(image);
      toast.setView(getLayoutInflater().inflate(R.layout.toastdesign, null));
      toast.setDuration(Toast.LENGTH_LONG);
      toast.show();
  
  }
  </code></pre>