Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 当我将语言切换为阿拉伯语时,通话记录页面不显示数据_Android_Arabic_Calllog_No Data - Fatal编程技术网

Android 当我将语言切换为阿拉伯语时,通话记录页面不显示数据

Android 当我将语言切换为阿拉伯语时,通话记录页面不显示数据,android,arabic,calllog,no-data,Android,Arabic,Calllog,No Data,在我的android项目中,当我切换语言为阿拉伯语时,呼叫日志页面不显示数据,但当我切换到其他语言(如英语)时,可以正确显示,如何解决,请参见以下信息 1.callLog适配器的部分代码如下所示: //显示归属地 if (callLog.getBelong_area() != null && !callLog.getBelong_area().equals("")) { LogE.e("item","有归属地:"+callLog.getB

在我的android项目中,当我切换语言为阿拉伯语时,呼叫日志页面不显示数据,但当我切换到其他语言(如英语)时,可以正确显示,如何解决,请参见以下信息

1.callLog适配器的部分代码如下所示:

 //显示归属地
        if (callLog.getBelong_area() != null && !callLog.getBelong_area().equals("")) {
            LogE.e("item","有归属地:"+callLog.getBelong_area());
            holder.belong_area.setVisibility(View.VISIBLE);
            holder.belong_area.setText(callLog.getBelong_area());
        } else {
            LogE.e("item","没有有归属地");
            holder.belong_area.setText("");
            holder.belong_area.setVisibility(View.GONE);
        }
2.输入固定值时仍不显示数据,如:

holder.belong_area.setText("北京"); 
3.按如下方式打印日志:

08-23 10:07:13.241 17494-17494/com.allinone.callerid E/项目:有归属地:北京 08-23 10:07:13.607 17494-17494/com.allinone.callerid E/项目: 有归属地:河北省石家庄08-23 10:07:13.674 17494-17494/com.allinone.callerid E/项目:有归属地:北京 08-23 10:07:13.714 17494-17494/com.allinone.callerid E/项目:有归属地:湖北省,武汉市

4.运行时屏幕截图:

阿拉伯语(错误)


您的系统应该有适当的字符集

您可以检查以下代码以检测语言的字符集

public class CharsetDetectTest {

    public static void main(String[] args) {
        detectCharset("北京");
    }

    public static void detectCharset(String originalStr) {

        String[] charSet 
          = { "utf-8", "big5", "EUC-CN", "iso-8859-1", "gb2312" };

        for (int i = 0; i < charSet.length; i++) {
            for (int j = 0; j < charSet.length; j++) {
                try {
                    LogE.e("charaters",
                        "[" + charSet[i] + "==>" + charSet[j] + "] = "
                        + new String(originalStr.getBytes(charSet[i]), charSet[j]));
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
然后,使用一个正确的字符集

holder.belong_area.setText(new String("北京".getBytes("utf-8"), "utf-8")); 

你可以查一下汉字


祝您好运,

您的系统应该有合适的字符集

您可以检查以下代码以检测语言的字符集

public class CharsetDetectTest {

    public static void main(String[] args) {
        detectCharset("北京");
    }

    public static void detectCharset(String originalStr) {

        String[] charSet 
          = { "utf-8", "big5", "EUC-CN", "iso-8859-1", "gb2312" };

        for (int i = 0; i < charSet.length; i++) {
            for (int j = 0; j < charSet.length; j++) {
                try {
                    LogE.e("charaters",
                        "[" + charSet[i] + "==>" + charSet[j] + "] = "
                        + new String(originalStr.getBytes(charSet[i]), charSet[j]));
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
然后,使用一个正确的字符集

holder.belong_area.setText(new String("北京".getBytes("utf-8"), "utf-8")); 

你可以查一下汉字

致以最良好的祝愿