首先该类必须实现
Serializable
接口
该页面代码:
ForAttractions myattractions=
forAttractionsList.get(position)
;
//Toast.makeText(ResultRouteActivity.this,myattractions.getName(),Toast.LENGTH_SHORT).show();
Intent intent=
new Intent(ResultRouteActivity.
this,SingleDetailActivity.
class)
;
Bundle bundle=
new Bundle()
;
bundle.putSerializable(
"myattractions",myattractions)
;
intent.putExtras(bundle)
;
startActivity(intent)
; 下一个页面
Intent intent=getIntent()
;
forAttractions=(ForAttractions)intent.getSerializableExtra(
"myattractions")
;
Toast.
makeText(SingleDetailActivity.
this,forAttractions.getName()+
","+
forAttractions.getLocal()
,Toast.
LENGTH_SHORT).show()
;
转载请注明原文地址: https://ju.6miu.com/read-672546.html