main.xml 文件是:
<ListView
android:id="@+id/listViewMovies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:cacheColorHint="@android:color/transparent"
android:divider="#0EBDFE"
android:dividerHeight="2dp"
android:fadingEdge="none" />
这是我的 listview 的 onclick 事件:
listViewMovies.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view, int pos,
long arg3) {
// TODO Auto-generated method stub
Log.i("MainActivity", "clicked position: " + pos);
Intent intent = new Intent(getApplicationContext(),
MovieDetailsActivity.class);
intent.putExtra("id", arrayIds.get(pos));
intent.putExtra("name", arrayTitles.get(pos));
intent.putExtra("release_date", arrayReleaseDate.get(pos));
intent.putExtra("casts", arrayAbridgedCast.get(pos));
intent.putExtra("critics_consensus",
arrayCriticsConsensus.get(pos));
intent.putExtra("synopsis", arraySynopsis.get(pos));
intent.putExtra("trailor", arrayLinks.get(pos));
intent.putExtra("thumb_img", arrayThumbPosters.get(pos));
intent.putExtra("profile_img", arrayProfilePosters.get(pos));
startActivity(intent);
}
});
但有时会调用点击事件,但有时不会。
谁能建议我应该有什么问题?