Skip to content

Commit

Permalink
Check for available activities before sending export file
Browse files Browse the repository at this point in the history
  • Loading branch information
codinguser committed Oct 18, 2015
1 parent d934118 commit 3dad27d
Show file tree
Hide file tree
Showing 33 changed files with 44 additions and 3 deletions.
15 changes: 12 additions & 3 deletions app/src/main/java/org/gnucash/android/export/ExportAsyncTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
Expand Down Expand Up @@ -451,13 +453,20 @@ private void shareFile(String path) {
}
SimpleDateFormat formatter = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance();

ArrayList<CharSequence> extraText = new ArrayList<CharSequence>();
ArrayList<CharSequence> extraText = new ArrayList<>();
extraText.add(mContext.getString(R.string.description_export_email)
+ " " + formatter.format(new Date(System.currentTimeMillis())));
shareIntent.putExtra(Intent.EXTRA_TEXT, extraText);

if (mContext instanceof Activity)
mContext.startActivity(Intent.createChooser(shareIntent, mContext.getString(R.string.title_select_export_destination)));
if (mContext instanceof Activity) {
List<ResolveInfo> activities = mContext.getPackageManager().queryIntentActivities(shareIntent, 0);
if (activities != null && !activities.isEmpty()) {
mContext.startActivity(Intent.createChooser(shareIntent, mContext.getString(R.string.title_select_export_destination)));
} else {
Toast.makeText(mContext, R.string.toast_no_compatible_apps_to_receive_export,
Toast.LENGTH_LONG).show();
}
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-af-rZA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ar-rSA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ca-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Mes actual</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-da-rDK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ Ingen brukerinformasjon vil bli delt i denne prosessen!
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ No user-identifiable information will be collected as part of this process!</str
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-el-rGR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ No user-identifiable information will be collected as part of this process!
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-en-rGB/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es-rMX/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ Este proceso solo recoge información que no permite identificar al usuario</str
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Mes actual</item>
<item>Últimos 3 meses</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ Este proceso solo recoge información que no permite identificar al usuario</str
<string name="title_translate_gnucash">Traducir GnuCash</string>
<string name="summary_google_plus">Compartir ideas, discutir cambios o reportar problemas</string>
<string name="summary_translate_gnucash">Traducir o revisar en CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Mes actual</item>
<item>Últimos 3 meses</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fi-rFI/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ Aucune information permettant d\'identifier l\'utilisateur ne sera recueillis da
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Mois actuel</item>
<item>3 derniers mois</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-hu-rHU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ No user-identifiable information will be collected as part of this process!
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-it-rIT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ No user-identifiable information will be collected as part of this process!
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-iw-rIL/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ja-rJP/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ko-rKR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-nl-rNL/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ No user-identifiable information will be collected as part of this process!
<string name="title_translate_gnucash">GnuCash Vertalen</string>
<string name="summary_google_plus">Ideeën uitwisselen, bespreken van wijzigingen of problemen melden</string>
<string name="summary_translate_gnucash">Vertalen of nalezen op CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Huidige maand</item>
<item>Afgelopen 3 maanden</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-no-rNO/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pl-rPL/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Bieżący miesiąc</item>
<item>Ostatnie 3 miesiące</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ Neste processo não serão recolhidas informações do utilizador!</string>
<string name="title_translate_gnucash">Traduzir GnuCash</string>
<string name="summary_google_plus">Compartilhe ideias, discuta alterações ou reporte problemas</string>
<string name="summary_translate_gnucash">Traduza ou corrija as traduções no Crowdln</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Mês atual</item>
<item>Last 3 meses</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pt-rPT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ Neste processo não serão recolhidas informações do utilizador!</string>
<string name="title_translate_gnucash">Traduza o GnuCash</string>
<string name="summary_google_plus">Partilhe ideias, discuta alterações ou reporte problemas</string>
<string name="summary_translate_gnucash">Traduza ou reveja em Crowdin</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Mês actual</item>
<item>Últimos 3 meses</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ro-rRO/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@
<string name="title_translate_gnucash">Перевести GnuCash</string>
<string name="summary_google_plus">Поделиться идеями, обсудить изменения или сообщить о проблемах</string>
<string name="summary_translate_gnucash">Перевести или вычитать на CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Текущий месяц</item>
<item>Последний квартал</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-sr-rSP/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-sv-rSE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-tr-rTR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-uk-rUA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@
<string name="title_translate_gnucash">Перекласти GnuCash</string>
<string name="summary_google_plus">Поділитися ідеями, обговорити зміни або повідомити про проблеми</string>
<string name="summary_translate_gnucash">Перекласти або вичитати на CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Поточний місяць</item>
<item>Останній квартал</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-vi-rVN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ No user-identifiable information will be collected as part of this process!
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ No user-identifiable information will be collected as part of this process!
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@
<string name="title_translate_gnucash">Translate GnuCash</string>
<string name="summary_google_plus">Share ideas, discuss changes or report problems</string>
<string name="summary_translate_gnucash">Translate or proof-read on CrowdIn</string>
<string name="toast_no_compatible_apps_to_receive_export">No compatible apps to receive the exported transactions!</string>
<string-array name="report_time_range">
<item>Current month</item>
<item>Last 3 months</item>
Expand Down

0 comments on commit 3dad27d

Please sign in to comment.