私はその特定のタグでポスト仲間のリストにタグをリダイレクトしようとしていると私はRetrofitインターフェイスでRecyclerViewの位置を取得する方法は?
private final static String TAG_KEY = "1"; //How Do I Make it to take Position of RecyclerView so that post associate with that Tag can be opened
ApiInterface apiService =
ApiClient.getClient().create(ApiInterface.class);
Call<Tag> call = apiService.getTag(TAG_KEY);
call.enqueue(new Callback<Tag>() {
@Override
public void onResponse(Call<Tag> call, Response<Tag> response) {
int statusCode = response.code();
List<Post> tags = response.body().getTagPosts();
recyclerView.setAdapter(new PostListAdapter(tags, R.layout.list_item_post, getApplicationContext()));
}
@Override
public void onFailure(Call<Tag> call, Throwable t) {
// Log error here since request failed
Log.e(TAG, t.toString());
}
});
下記のコード上のクリックしたRecyclerViewの位置を見つけ、合格に問題が生じていますそして、どのように私はインターフェイスを呼び出します私が正しくあなたを取得する場合意向アダプタInstateに
@Override
public void onBindViewHolder(TagAdapter.Tag_ViewHolder holder, final int position) {
holder.tagName.setText(Tags.get(position));
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Toast.makeText(context, "Recycle Click" + position, Toast.LENGTH_SHORT).show();
if (position == 0){
Intent intent = new Intent (view.getContext(), TagToPostActivitiy.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
List of Post Associated with Tag CList of Tag
でAPI要求を処理する必要がありますあなたはクリックしてアクセスしたいですか?またはlastVisible?またはFirstVisible?あなたの質問は明確ではありません。 –
私は自分のアプリケーションの画像を添付して、私はcardviewに記載されているそのタグに関連付けられた投稿を読み込みたいと思います。あなたはこのリンクを見て理解できない場合:http://api.technorio.com/ –