English 中文(简体)
我应创建多个隐藏列表视图, 或者仅一个, 更改内容
原标题:Should I create multiple hidden ListViews or just one and change the contents

因此,我有一个活动将显示一个选项列表, 当您单击一个选项时, 它应该移动到一个列表, 显示该选项的选项, 但我希望两个列表都在同一活动中 。

我在辩论使用单一列表视图和修改内容这两个选项(如果适用,可以互换适配器,但不确定),每当用户在两个列表之间浏览时,或者使用像查看器一样的两种列表独立存在,但每次只能看到一个。

我肯定地认为,更清洁的选择是透视器的选项,但如果我需要将其扩大至两个以上的列表,它将如何运作呢? 创建一份没有实现的列表视图是否有很多管理费用?

最佳回答

保持一个列表视图并切换其后端将是一个痛苦, 特别是考虑到每次点击一个选项时, 所有的重新初始化 。

- 使用两个列表碎片, 一个控制另一个控制。 使用碎片而不是两个单独的列表活动将意味着当您建立一个平板界面时, 在同一屏幕上同时使用一个活动是最小的 。

- 使用 < a href=>" "http:// developmenter.android.com/ reference/android/widget/ ExpandableListView.html" rel = "nofollow" > 扩大的ListView

问题回答

I did have a choice like that. I was using a list view to navigate to a remote webdav server. At the beginning I was using one view for each folder. It was cool: using back was allowing me not to worry about navigation history. But after a while, there was some cases where I needed to manage all the views at once, or kill them all or implement a communication between views (for parameters). And it was a nightmare to achieve. Also my list were beginning to be heavy and a lot of list in memory is never a good thing. I finally gave up and managed all the navigation in a unique list view. I should have do it at first.





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签