Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File getdbdatapath= Environment.getDataDirectory();
- String currentDBPath = "/data/com.example.appname/databases/dbname/";
- File path=new File(getdbdatapath, currentDBPath);
- Log.d("Path", path.toString());
- //File extdb= Environment.getExternalStorageDirectory();
- //String extpath=extdb+"/NewFolder/dbname";
- //File pathp=new File(extdb, extpath);
- //Log.d("New Path", pathp.toString());
- Log.i(getClass().getSimpleName(), "send task - start");
- final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
- String address = "clientmailid@gmail.com";
- String subject = "Application Database";
- String emailtext = "Please check the database as attachement";
- //emailIntent.setType("Application/database");
- //emailIntent.setType("text/html");
- //emailIntent.setType("message/rfc822");
- emailIntent.setType("vnd.android.cursor.dir/email");
- emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { address });
- emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
- emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + path));
- emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext);
- startActivity(Intent.createChooser(emailIntent, "Send Mail..."));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement