android force date inside RecyclerView to re render
mAdapter.notifyDataSetChanged();
android force date inside RecyclerView to re render
mAdapter.notifyDataSetChanged();
android recyclerview pull to refresh
public class BooksActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener {
SwipeRefreshLayout swipLayout;
RecyclerView recyclerview;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
recyclerview = view.findViewById(R.id.recyclerview);
swipLayout = view.findViewById(R.id.swipe_layout);
swipLayout.setOnRefreshListener(this);
}//end of onCreate
@Override
public void onRefresh() {
//your refresh code here
loadRecyclerViewData()
}
private void loadRecyclerViewData(){
onSuccess(){
//don't forget to stop refreshing
swipLayout.setRefreshing(false);
}
onFaliure(){
//don't forget to stop refreshing
swipLayout.setRefreshing(false);
}
}
}
android recyclerview pull to refresh
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/layout_titlebar">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/layout_titlebar"
android:layout_margin="5dp"
/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us