translation - Bing Translate Android Set Language -
my app uses bing translate api . want set target language here:
@override public void onclick(view v) { translate.setclientid("hidden"); translate.setclientsecret("hidden"); try { string translatedtext = translate.execute(texttotranslate, language.english/* <----target language */); b.settext(translatedtext); } catch (exception e) { toast.maketext(this,"fail!",toast.length_long); } }
but target language should string . when using string got error cant use string here. me , please ?
sammy
the target language parameter not string
. language
enum class. can use have in code you've posted, or can call language.valueof()
appropriate value pass execute()
method.
for example:
string translatedtext = translate.execute(texttotranslate, language.valueof("english"));
Comments
Post a Comment