0

こんにちは Twitter クライアントで作業していますが、ツイートを作成してアラビア語または日本語で投稿すると、それが受け入れられません。なぜ ?

それがツイートを投稿する方法です:

public void postTweet(String body, AsyncHttpResponseHandler handler) {
    Log.i(CLASS, "statuses/update.json");
    String apiUrl = getApiUrl("statuses/update.json");
    RequestParams params = new RequestParams();
    params.put("status", body);
    getClient().post(apiUrl, params, handler);
}

それは送信ボタンをクリックした後です:

  send.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            TwitterClient client = RestApplication.getRestClient();
            client.postTweet(tweet.getText().toString(), new AsyncHttpResponseHandler() {
                @Override
                public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
                    Toast.makeText(getActivity(), "Sent Successfully", Toast.LENGTH_LONG).show();
                    dismiss();
                }

                @Override
                public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
                    Log.e(CLASS, "Error sending the tweet. Status: " + statusCode, error);
                    Toast.makeText(getActivity(), "Error sending the tweet, please try again.", Toast.LENGTH_LONG).show();
                }
            });
        }
    });

助けてください

4

1 に答える 1

0

charset を指定する必要があります。

これを試して :

ContentType.create("application/json", CharSet.forName("UTF-8"));
于 2015-12-06T08:52:53.180 に答える