title: Export SQLite Data to SD Card - File Not Found Exception
body: <p>I am trying to get SQLite Internal Storage Data to SD Card, but everytime i am getting File Not Found Exception.</p>
  
  <p>This is the class, which i am using to get data and then store to SD Card, check below:</p>
  
  <p><strong>MainActivity.java</strong> is the only class i am using in my program to get data.</p>
  
  <pre><code>package com.export.data;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.activity_main);
  
          Button btn = (Button)findViewById(R.id.btnGetData);
          btn.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  InputStream myInput;
                  try {
                      myInput = new FileInputStream("/data/data/com.example.parsingsqlite/databases/storeJSON.db");//this is
                      // Set the output folder on the SDcard
                      File directory = new File("/sdcard/Hello");
                      // Create the folder if it doesn't exist:
                      if (!directory.exists()) 
                      {
                          directory.mkdirs();
                      } 
                      // Set the output file stream up:
  
                      OutputStream myOutput = new FileOutputStream(directory.getPath()+"/storeJSON.db");
  
                      // Transfer bytes from the input file to the output file
                      byte[] buffer = new byte[1024];
                      int length;
                      while ((length = myInput.read(buffer))&gt;0)
                      {
                          myOutput.write(buffer, 0, length);
                      }
                      // Close and clear the streams
                      myOutput.flush();
  
                      myOutput.close();
  
                      myInput.close();
  
                  } catch (FileNotFoundException e) {
                      Toast.makeText(MainActivity.this, "File Not Found", Toast.LENGTH_LONG).show();
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  } catch (IOException e) {
                      Toast.makeText(MainActivity.this, "IOException", Toast.LENGTH_LONG).show();
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
                  Toast.makeText(MainActivity.this, "Backup Done Succesfully!", Toast.LENGTH_LONG).show();
  
              }
          });
  
      }
  }
  </code></pre>
  
  <p><strong>Note:</strong> If i use same code in same application whose data want to retrieve then getting, but if trying to get data from another application by doing tap on button then getting FileNotFound Exception. (like doing now)</p>