こんにちはこれは私のlistviewonClicklisterです。
リスト項目をクリックすると、Beanクラスから取得しているarraylistを次のような別のアクティビティに渡します。
しかし、Beanクラスを次のアクティビティに渡すことができるか知りたいですか?
listViewRoutes.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
RouteBean bean = routeList.get(arg2);
ArrayList<Double> fromLatitude = bean.getFromLatitude();
ArrayList<Double> fromLongitude= bean.getFromLongitude();
ArrayList<Double> toLatitude = bean.getToLatitude();
ArrayList<Double> toLongitude= bean.getToLongitude();
Intent intent =new Intent("MapActivityView");
intent.putExtra("fromLon", fromLongitude);
intent.putExtra("fromLat", fromLatitude);
intent.putExtra("toLat", toLatitude);
intent.putExtra("toLon", toLongitude);
startActivity(intent);
}
});
「RouteBean」を渡すと、次のアクティビティの値を取得します。
Beanクラスを渡すことは可能ですか?