小米4异常,其他手机正常,百思不得其解。
请求:http://music.163.com/api/search/pc?type=1&s=邓紫棋&limit=20&offset=0
void search() {
String s = editText_search.getText().toString();
try {
s = URLEncoder.encode(s, "UTF-8"); //中文转码
} catch (Exception e) {
Toast.makeText(MainActivity.this, e.toString(), Toast.LENGTH_SHORT).show();
}
......
}
请求变成了:http://music.163.com/api/search/pc?type=1&s=%E9%82%93%E7%B4%AB%E6%A3%8B&limit=20&offset=0