Here is an approach that works with the current version of google translate and will likely keep working with future updates (as long as the package name stays the same): if (_INT >= Build.VERSION_CODES. The Google Translate activity names tend to change over time which makes the code fragile if you hardcode them. I.putExtra("key_from_floating_window", false) I.putExtra("key_suggest_translation", "") I.putExtra("key_text_input", "Me gusta la cerveza") So my final version, including hard-coded translation from Spanish to English, is: Intent i = new Intent() The difference is that "translation" has been added before "TranslateActivity" However it didn't work initially for me and after investigating the Translate apk, it looks like they've modified their file structure slightly, so the intent ComponentName should now be: i.setComponent( Translate combines high-quality translations with an intuitive design, so that translating is quick and easy. Designed to be the best and easiest-to-use app for translating phrases, conversations, and even the text around you. Phi Van Ngoc's answer was fantastic, thanks for that. Translate lets you quickly and easily translate your voice and text between any combination of 11 languages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |