![]() ![]() 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) Like the web application, the Android app will allow you to translate more than 50 different languages, among which of course English and Spanish are included. I.putExtra("key_suggest_translation", "") If you want to have the official app of the popular Google Translate on your Android device, this is for you. 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( 7.37148.2-release Older versions Advertisement If you want to have the official app of the popular Google Translate on your Android device, this is for you. Phi Van Ngoc's answer was fantastic, thanks for that.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |