+
+
+ /**
+ * Start activity for sending email with logs attached
+ */
+ private void sendMail() {
+
+ String emailAddresses[] = { getText(R.string.mail_logger).toString() };
+
+ Uri uri = Uri.parse("file://" + mLogPath + File.separator + LOGGER_FILE_NAME);
+ Intent intent = new Intent(Intent.ACTION_SEND);
+
+ // Explicitly only use Gmail to send
+ intent.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail");
+
+ intent.putExtra(Intent.EXTRA_EMAIL, emailAddresses);
+ intent.putExtra(Intent.EXTRA_SUBJECT, getText(R.string.log_mail_subject));
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setType(MAIL_ATTACHMENT_TYPE);
+
+ intent.putExtra(Intent.EXTRA_STREAM, uri);
+ if (intent.resolveActivity(getPackageManager()) != null) {
+ startActivity(intent);
+ }
+ }
+
+
+ /**
+ * Read and show log file info
+ */
+ private void readLogFile() {
+
+ //Get the text file
+ File file = new File(mLogPath,LOGGER_FILE_NAME);
+
+ //Read text from file
+ StringBuilder text = new StringBuilder();
+
+ try {
+ BufferedReader br = new BufferedReader(new FileReader(file));
+ String line;
+
+ while ((line = br.readLine()) != null) {
+ text.append(line);
+ text.append('\n');
+ }
+ }
+ catch (IOException e) {
+
+ }
+
+
+ TextView logTV = (TextView) findViewById(R.id.logTV);
+ logTV.setText(text);