2011-05-05 22 views
0

我正在開發Android中的應用程序。我需要iOS中的表格視圖功能。 iOS Table View具有選擇功能。如何在Android中實現這個功能?Android中的表格視圖

我已經創建了一個列表視圖,其中一個選項卡上的列表由列表中的數組填充,但現在在特定的列表項上單擊我要加載新班級並且還必須執行新活動,請爲此指導我。 這裏是我的代碼

thanx提前

回答

0

我不知道一個表視圖是在iPhone上的東西,但它聽起來像一個TabHost會做你想要什麼。看看Tab Layout tutorial

0

如果您使用的是列表,您需要添加OnItemClickListener與ListView對象。

在該方法中,你可以開始新的活動e.g

public void onItemClick(AdapterView<?> listView, View v, int position, long id) { 

    Intent n = new Intent(CurrentActivity.this, MyNewActivity.class); 

    //You can pass data to new activity if any 
    //n.putExtra("data", "This is my data"); 


    startActivity(n); 
}