的我正在開發一個Android應用程序,在這裏我顯示在ListView接觸的所有名稱。序列化對象的ArrayList的Hashmap
聯繫人列表視圖中的onclick,我需要顯示在列表視圖另一個是聯繫的相應的數目。
這裏的問題是,我捆綁所有的數字和發送它的另一個活動,也獲得了捆綁,但收到的包是序列化對象。
所以,在ListView我需要將其轉換爲的Hashmap的ArrayList中dispaly。 我該怎麼做?
下面是代碼:
發送活動:
HashMap<String, String> Numbermap = new HashMap<String, String>();
Numbermap.put("numb",number);
Numbermap.put("type",type);
NumberList.add(Numbermap);
Intent intent = new Intent (ContactNames.this,ContactsPhoneNumbers.class);
intent.putExtra("map", NumberList);
startActivity(intent);
接收活動:
Serializable Numbermap = new HashMap<String, String>();
// contNum = (TextView)findViewById(R.id.ContactNumber);
Bundle bundle = getIntent().getExtras();
Intent intent = getIntent();
if(bundle!=null)
{
Numbermap = bundle.getSerializable("map");
}
我的壞。非常感謝您的幫助! – LISA