title: Couldn't read row 0, col 0 from CursorWindow
body: <p><strong>java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.</strong></p>
  
  <pre><code>public class MyProfile extends AppCompatActivity {
      private Context mContext;
      private ImageView i1, i2,i3;
      private static final int SELECT_IMAGE = 1;
      private StoreProfileData mStore;
      SQLiteDatabase db;
      String path;
      Cursor cursor,c;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_my_profile);
          mContext = MyProfile.this;
          i1 = (ImageView) findViewById(R.id.user_profile_photo);
          i2 = (ImageView) findViewById(R.id.user_profile_photo_hidden);
          i3 = (ImageView) findViewById(R.id.header_cover_image);
          db=this.openOrCreateDatabase("test.db",Context.MODE_PRIVATE,null);
          db.execSQL("create table if not exists tb(a blob)");
  
      }
      public void initialize() {
          i2.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent i = new Intent(Intent.ACTION_PICK,
                          android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
                  final int ACTIVITY_SELECT_IMAGE = 1234;
                  startActivityForResult(i, ACTIVITY_SELECT_IMAGE);
              }
          });
      }
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          switch (requestCode) {
              case 1234:
                  if (resultCode == RESULT_OK) {
                      Uri selectedImage = data.getData();
                      String[] filePathColumn = {MediaStore.Images.Media.DATA};
                      cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
                      cursor.moveToFirst();
                      int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
                      String filePath = cursor.getString(columnIndex);
                      File f = new File(filePath);
                      path=f.getPath();
                      Log.d("path",path);
                      cursor.close();
                //      Bitmap yourSelectedImage = BitmapFactory.decodeFile(filePath);
                   //   i2.setImageBitmap(yourSelectedImage);
  
                  }
          }
      }
  </code></pre>
  
  <p><strong>save image method it is succesfully instereted path into
   sqlite database</strong> </p>
  
  <pre><code>    public void saveImage(View view)
      {
          try {
              FileInputStream fts = null;
              fts = new FileInputStream(path);
              byte[]image=new byte[fts.available()];
              fts.read(image);
              ContentValues values=new ContentValues();
              values.put("a",image);
              db.insert("tb", null, values);
              fts.close();
              Toast.makeText(this,"inserted",Toast.LENGTH_LONG).show();
          }
          catch (IOException e){
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p><strong>getImage method for get image from inserted into database here i get the error mesg</strong></p>
  
  <pre><code>    public void getImage(View view) {
              cursor = db.rawQuery("select * from tb", null);
          Log.d("dv", String.valueOf(cursor));
          if (cursor.getCount() &gt; 0) {
              Log.d("crsr", "sdds");
              if (cursor.moveToNext()) {
                  byte[] image = cursor.getBlob(0);
                  Bitmap bmp = BitmapFactory.decodeByteArray(image, 0, image.length);
                  i2.setImageBitmap(bmp);
                  Toast.makeText(this, "selected", Toast.LENGTH_LONG).show();
              }
          }
      }
  }
  </code></pre>