Ormliteを使用して永続レイヤーを実装しています。アプリケーションにコードのいくつかの部分で再利用できるボタンが含まれているため、を実装し、OrmLiteBaseActivity<DataBaseHelper>
ここで、DataBaseHelper
はデータベース操作のための私のヘルパーです。しかし、私がそれをしてDaoにButton
クラスのonClick()
メソッド内のオブジェクトを永続化させようとすると、は決して呼ばれなかったと言って、IllegalArgumentException
を得る。 SaveButton
クラスで、その後、Ormliteを使用したAndroidプロジェクトのOnClickListenerの実装
saveButton = (Button) findViewById(R.id.SaveProfileButton);
saveButton.setTag(profile);
saveButton.setOnClickListener(new SaveButton());
をと:私は以下のようにやっているgetHelper
を評価する際に
Dao<Profile, Long> profileDao = null;
Profile profileToSave = null;
try {
profileDao = getHelper().getProfileDao();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
エラーが発生します。何か案は? ありがとうございます!
おそらくこのスレッドは助けることができる:http://stackoverflow.com/questions/7702591/alert-dialog-inside-a-setclickonlistener-not-showing – Niloct
はあなたに@Niloctをありがとう、私はdon'ttそのスレッドが私を助けることができます。問題は異なります。 – jpaulo