]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Trying to update to newest Android settings.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index fe0e57fb2243c767e8d62b18cba48fabd301bc64..56ded03c6c97e86634905d7f435546141795a1ff 100644 (file)
@@ -422,8 +422,8 @@ public class DictionaryActivity extends ListActivity {
     protected void onResume() {
         Log.d(LOG, "onResume");
         super.onResume();
-        if (PreferenceActivity.prefsMightHaveChanged) {
-            PreferenceActivity.prefsMightHaveChanged = false;
+        if (SettingsActivity.settingsMightHaveChanged) {
+            SettingsActivity.settingsMightHaveChanged = false;
             finish();
             startActivity(getIntent());
         }
@@ -787,6 +787,18 @@ public class DictionaryActivity extends ListActivity {
             }
         });
 
+        final MenuItem share = menu.add("Share");
+        share.setOnMenuItemClickListener(new OnMenuItemClickListener() {
+            public boolean onMenuItemClick(MenuItem item) {
+                Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
+                shareIntent.setType("text/plain");
+                shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, row.getTokenRow(true).getToken());
+                shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, row.getRawText(saveOnlyFirstSubentry));
+                startActivity(shareIntent);
+                return false;
+            }
+        });
+
         final MenuItem copy = menu.add(android.R.string.copy);
         copy.setOnMenuItemClickListener(new OnMenuItemClickListener() {
             public boolean onMenuItemClick(MenuItem item) {