我想将单个字符串传递给异步任务。谁能告诉我它是怎么做的?我的 getEntity 需要方法 getEntity(Activity, String, EntityGetListener) 但我一直在传递这个 String[]
String pass= story.get(position).getEntity();
new RemoteDataTask().execute(pass);
private class RemoteDataTask extends AsyncTask<String, String, Long> {
@Override
protected Long doInBackground(String... params) {
// TODO Auto-generated method stub
EntityUtils.getEntity(activity, params, new EntityGetListener() {
@Override
public void onGet(Entity entity) {
viewcount = entity.getEntityStats().getViews();
}
@Override
public void onError(SocializeException error) {
}
});
return null;
}
}