使用eclipse开发Android应用程序。在用户的信息页面上,如果我在fullname字段(TextView
)中插入阿拉伯语文本,则会保存问号;然后再在同一个字段中保存一些阿拉伯语文本..它保存正确的文本;下次再问问题,然后更正文字..等等。
所以基本上它会在每次替代尝试中保存正确的文本。我已经证实这超过100次
文件编码为 UTF-8
以下是文本框的代码:
<EditText
android:id="@+id/client_name_setting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/client_user_profile"
android:background="@drawable/edit_bg"
android:imeOptions="actionNext"
android:singleLine="true"
android:text="@string/name"
android:textSize="16dp" >
</EditText>
我们正在使用volley通过webservice
保存详细信息public static void UpdateVendorWithoutFile(final String user_id,
final String category_id, String full_name,
final String email, String prefered_lang, final String email_alert,
final String contact_number, final String address,
ArrayList<String> location, final String national_id,
final String about, final String org_name, String nationality_id,String onlinestatus,
final Context context, final UpdateVendorCallback callmessage) {
String url = NetUtils.update_vendor;
JsonArray array = new Gson().toJsonTree(location).getAsJsonArray();
CustomJsonObjectRequest request = new CustomJsonObjectRequest(
Request.Method.POST, url, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject jsonObject) {
Log.v("TAG", "Success " + jsonObject.toString());
callmessage.UpdateVendorSuccess(jsonObject.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
if (volleyError instanceof TimeoutError
|| volleyError instanceof NoConnectionError) {
callmessage.UpdateVendorError(context
.getResources().getString(
R.string.connection_error));
} else if (volleyError instanceof AuthFailureError) {
callmessage.UpdateVendorError(context
.getResources().getString(
R.string.auth_error));
} else if (volleyError instanceof NetworkError) {
callmessage.UpdateVendorError(context
.getResources().getString(
R.string.net_error));
} else if (volleyError instanceof ServerError) {
callmessage.UpdateVendorError(context
.getResources().getString(
R.string.server_error));
} else if (volleyError instanceof ParseError) {
callmessage.UpdateVendorError(context
.getResources().getString(
R.string.parse_error));
}
}
});
request.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 0,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
HashMap<String, String> params = new HashMap<String, String>();
params.put("user_id", user_id);
params.put("category_id", category_id);
params.put("full_name", full_name);
params.put("email", email);
params.put("preffered_language", prefered_lang);
params.put("email_alert", email_alert);
params.put("contact_number", contact_number);
params.put("address", address);
params.put("location", array.toString());
params.put("national_id", national_id);
params.put("about", about);
params.put("org_name", org_name);
params.put("nationality_id", nationality_id);
params.put("online_status", onlinestatus);
params.put("lang", Locale.getDefault().getLanguage());
request.setParams(params);
RequestQueue queue = Volley.newRequestQueue(context);
queue.add(request);
}
我真的很感激这方面的任何帮助。
这些是我在发布此问题之前提到的问题:
Text view displays Arabic characters as question marks "?????"