title: How can i pass image view between activities in android
body: <p>I want to send the ImageView form one activity to another activity. When i am trying to pass the image view from Class A to Class B using bundle concept then in class B it's showing null pointer exception.Below is my code of class A.</p>
  
  <pre><code>  public class First extends Activity {
      Cursor cursor1;
      boolean y,n;
      ImageView login;
      Button  enroll;
      String AndroidId;
      SQLiteDatabase db1,db;
      private ContentValues values;
      DopenHelper helper;
  
  
      String TableName = "tbl_finger";
      ImageView FingerImageData;
      String fingerID,DivID,enrolledtype;
  
  
  
      @Override
      protected void onPause() {
          // TODO Auto-generated method stub
          super.onPause();        
          helper.close();
          db.close();
          db1.close();
  
      }
  
      protected void onResume() 
      {
          // TODO Auto-generated method stub
          super.onResume();
          helper =new DopenHelper(getApplicationContext());
          db=helper.getWritableDatabase();
          db1=helper.getWritableDatabase();
          values=new ContentValues();
          enroll=(Button)findViewById(R.id.enroll_button);
  
  
  
          FingerImageData = (ImageView)findViewById(R.id.fingerid);
           AndroidId = Settings.Secure.getString(getContentResolver(),Settings.Secure.ANDROID_ID);
           //"[B@40520c28";
           //"com.a1technology.remoteid.First@4050f508";      
  
              helper = new DopenHelper(First.this);           
  
              cursor1 = db1.rawQuery("SELECT  template,enrolled,deviceID FROM " + TableName,  null);
  
              try {
  
                  db1 = this.openOrCreateDatabase("remoteid.db", MODE_PRIVATE, null);
  
                  if(cursor1 != null )
                  {
                      if(cursor1.moveToFirst())
                      {
                          do {
                              DivID = cursor1.getString(cursor1.getColumnIndex("deviceID"));
                              fingerID = cursor1.getString(cursor1.getColumnIndex("template"));
                              enrolledtype = cursor1.getString(cursor1.getColumnIndex("enrolled"));
  
                              //Toast.makeText(getApplicationContext(), DivID, Toast.LENGTH_LONG).show();
  
                          }while (cursor1.moveToNext());
                      }
                  }
  
              }
  
              catch(Exception e) {
                  Log.e("Error", "Error", e);
  
              } finally {
                  if (db1 != null)
                      db1.close();
  
              }   
  
              cursor1.close();  
  
               final Bundle bundle = new Bundle();
  
          enroll.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View arg0) {
  
  
                  if((FingerImageData.getContext().toString()).equals(fingerID))
                  {
                      Intent menuintent=new Intent(First.this,Menu.class);
                      bundle.putString("ThumbInfo2", FingerImageData.toString());                 
                      menuintent.putExtras(bundle);
                      startActivity(menuintent);
  
                  }  
                  /*else if((FingerImageData.getContext().toString()).equals(fingerID) &amp;&amp; AndroidId.equals(DivID)  )
                      {
                          Intent menuintent=new Intent(First.this,Menu.class);
                          startActivity(menuintent);
  
                      } */
                  else 
                  {
  
                      values.put("template", FingerImageData.getContext().toString());
                      values.put("enrolled", getEnrolledType());
                      values.put("DeviceID", AndroidId.getBytes().toString() );
                      db.insert("tbl_finger", "Id", values);
  
  
                      bundle.putString("ThumbInfo1", FingerImageData.toString());                     
                      Intent enroll=new Intent(First.this,Enroll.class);
                      enroll.putExtras(bundle);
                      startActivity(enroll);                      
  
                  }
  
              }
  
              private String getEnrolledType() {
                  // TODO Auto-generated method stub
                  //AndroidId.equals(DivID) &amp;&amp; 
                  if((FingerImageData.getContext().toString()).equals(fingerID)){
                      return "N";
  
                  }
                  else {
                      return "Y";
                  }
  
              }
          });  
  
      }
  
  
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);  
          setContentView(R.layout.first);         
  
      }
  
  }
  </code></pre>
  
  <p>here the error in class B:-</p>