Android。SQLite。Recyclerview

2020年5月16日

SQLite作成など

1 SQLiteOpenHelper

2 データベース作成

3 データの追加

4 データ読み出し ここからRecyclerView

SQLite RecyclerView

Androidアプリ開発 SQLite テーブルの検索、登録、更新、削除

SQLiteの場所

追加して、戻ってきて更新

        //戻ってきて、Recyclerviewを更新
        favoriteDataList.clear();
        favoriteDataList.addAll(db.getAllBoomarks());

        mAdapter.notifyDataSetChanged();

クリックしたら、リップルエフェクト。アニメ

1行rowに、「android:background="?android:attr/selectableItemBackground"」を加える

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    android:background="?android:attr/selectableItemBackground">