Eu recebo um array com itens de interesses e devo setá-los no setText
de um determinado TextView
, como posso fazer isso?
Segue o código:
@BindView(R.id.txtInterests)
TextView txt_interests;
CommunityPresenter presenter;
UserCommunity selectedUser;
List<String> interest = new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setEnterTransition(new Fade());
}
setContentView(R.layout.activity_ride_request);
ButterKnife.bind(this);
presenter = new CommunityPresenter(this);
first.setText(presenter.getDay(0));
second.setText(presenter.getDay(1));
third.setText(presenter.getDay(2));
user = new SessionManager();
selectedUser = CommunityService.i(getContext()).selectedUser;
reloadView();
send_offer_request.setOnClickListener(presenter.sendRequestOnClickListener(0));
send_ask_request.setOnClickListener(presenter.sendRequestOnClickListener(1));
populateInterests();
}
private void populateInterests() {
RequestManager.UsersInterests(selectedUser.id, new FutureCallback<String>() {
@Override
public void onCompleted(Exception e, String result) {
//array com os interesses
interest = new Gson().fromJson(new JsonParser().parse(result).getAsJsonObject().get("data").toString(), new TypeToken<ArrayList<String>>() {
}.getType());
txt_interests.setText(); //preencher o TextView com os interesses
}
});
}
Eu teria de montar uma lista Personalizada?