]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Make QuickDic handle ACTION_PROCESS_TEXT
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index 356e957ebaf8788645e898a1ac3d6b801ba04e7b..2bfb8c1089f0e4ff4be51e3c00faa18cace4121a 100644 (file)
@@ -300,6 +300,15 @@ public class DictionaryActivity extends ActionBarActivity {
             if (query != null)
                 getIntent().putExtra(C.SEARCH_TOKEN, query);
         }
+        /*
+         * This processes text on M+ devices where QuickDic shows up in the context menu.
+         */
+        if (intentAction != null && intentAction.equals(Intent.ACTION_PROCESS_TEXT)) {
+            String query = intent.getStringExtra(Intent.EXTRA_PROCESS_TEXT);
+            if (query != null) {
+                getIntent().putExtra(C.SEARCH_TOKEN, query);
+            }
+        }
         /**
          * @author Dominik Köppl If no dictionary is chosen, use the default
          *         dictionary specified in the preferences If this step does