前提・実現したいこと
Realmのデータを利用してbutterKnifeで値の取得を行い、Recycleviewに表示する処理。
発生している問題・エラーメッセージ
エラーの内容通りprivateを消しても、コンパイル時に再度強制的にprivateが作成されてしまう。
エラー: @Bind fields must not be private or static. (com.example.promoto.proc.BlogItemView.title)private android.widget.TextView title;
該当のソースコード
kotlin
1import android.content.Context 2import android.widget.RelativeLayout 3import android.widget.TextView 4import butterknife.Bind 5import butterknife.ButterKnife 6import android.view.View 7 8 9class BlogItemView(context: Context) : RelativeLayout(context) { 10 @Bind(R.id.title) 11 var title: TextView? = null 12 13 init { 14 init(context) 15 } 16 17 private fun init(context: Context) { 18 View.inflate(context, R.layout.realm_item_view, this) 19 ButterKnife.bind(this) 20 } 21 22 fun bind(maindatabase: MainDataBase) { 23 title!!.setText(maindatabase.title) 24 } 25}
java
1import java.lang.System; 2 3・・・省略 4public final class BlogItemView extends android.widget.RelativeLayout { 5 @org.jetbrains.annotations.Nullable() 6 @butterknife.Bind(value = {2131230956}) 7 private android.widget.TextView title; 8 private java.util.HashMap _$_findViewCache; 9 10・・・省略 11}
試したこと
ここに問題に対して試したことを記載してください。
対象のprivateを削除やpublicに変更などを行いましたがコンパイル時に、privateに戻されました。
補足情報(FW/ツールのバージョンなど)
こちらのサイトを参考:
https://github.com/thorbenprimke/realm-searchview/tree/master/example
作成済みのrealmデータを元に処理を行うように自分で変更しており、その際kotlinに変更を行いました。
実際にcodeを描いたのはkotlinのほうです。
javaのcodeはコンパイル時に自動生成されており、大きく変更は行っていません。
本当にどうしようもなくて困っています。助言お願いします...
開発環境:
android studio 3.0
gradle:
implementation 'com.jakewharton:butterknife:7.0.1'
implementation 'com.github.thorbenprimke:realm-searchview:0.9.6'

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/03 22:07