嗨,這是我的listview onClicklister。如何將豆類一項活動傳遞給Android上的另一項活動
當我點擊列表中的項目,我通過它從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);
}
});
如果我通過「路由Bean」,我得到下一個活動的值。
是否可以傳遞bean類?
看[這裏] [1]。有很多方法可以做到這一點。 [1]:http://stackoverflow.com/questions/11679574/app-design-pass-date-through-intents-or-use-singletons/11679728#11679728 – 2012-07-27 02:56:56