紛らわしい質問のタイトルで申し訳ありませんが、どのように表現すればよいかわかりませんでした...
問題は、ダウンロードした画像のサムネイルが画面にたくさんあることです。それらのいずれかがクリックされた場合、(とりわけ) 画像のより大きなバージョンを特徴とする新しいアクティビティが開始されます。
一部の画像では問題なく動作しますが、たまたま半分以上の画像では何もしないことに気付きました。コードは実行されますが (ログ メッセージが表示されます)、何も起こりません。
ImageView imageView = new ImageView(this);
imageView.setImageBitmap(locationBitmap.bitmap);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View image) {
Log.i(this.getClass().getName(), "You selected location: " + locationBitmap.location);
Intent i = new Intent(context, AnswerActivity.class);
i.putExtra("question_text", question_text);
i.putExtra("question_title", question_title);
i.putExtra("location", locationBitmap.location);
i.putExtra("bitmap", locationBitmap.bitmap);
Log.d(this.getClass().getName(), "About to start the activity...");
context.startActivity(i);
Log.d(this.getClass().getName(), "Started the activity...");
}
});
ログ メッセージはすべて正しく生成されますが、アクティビティが変化しない場合と変化する場合があります。何か案は?