开发者

issues with handling multiple languages on android

开发者 https://www.devze.com 2023-02-28 20:40 出处:网络
I ve been using google-api for my project therefore i need to display in other languages. I m using listview to show data. This code fails on assigning column values to \"str\" otherwise this code wor

I ve been using google-api for my project therefore i need to display in other languages. I m using listview to show data. This code fails on assigning column values to "str" otherwise this code works fine without converting language. I need to convert language.

        String str = cursor.getString(cursor.getColumnIndex("disease"));
        String st = Translate.execute(str, Language.ENGLISH, Language.FRENCH); 
      开发者_Python百科  String[] column = new String[] {st};

                adapter = new SimpleCursorAdapter(
                    this, 
                        R.layout.list, 
                        cursor, 
                        column, 
                        new int[] {R.id.Name});

                setListAdapter(adapter); 


use android localization concept.. http://developer.android.com/guide/topics/resources/localization.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号