让用户按预定义的排序顺序对列表视图进行排序的首选方式是什么?

| 你会用什么?菜单?上下文菜单?您是否愿意将特定ListView的排序顺序作为选项添加到应用程序的“设置”中?     
已邀请:
我已经在布局的顶部设置了指示排序顺序的按钮,每个按钮都对应于一个OnClickListener,后者获取了一个新的游标,然后简称为
adapter.changeCursor(newCursor);
在列表视图适配器上。 希望能有所帮助。     
在分析了不同的选项之后,我在屏幕顶部选择了一个微调器。这是现在的布局:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
   <LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"
android:orientation=\"vertical\" android:layout_width=\"fill_parent\"
android:layout_height=\"fill_parent\">

<LinearLayout android:orientation=\"horizontal\"
    android:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\">

    <Spinner android:layout_width=\"fill_parent\"
        android:layout_height=\"40sp\" android:id=\"@+id/spinner_sort_order \">     
    </Spinner>

</LinearLayout>

<FrameLayout android:layout_width=\"fill_parent\"
    android:layout_height=\"fill_parent\">        
    <ListView android:id=\"@android:id/list\" android:layout_width=\"fill_parent\"
        android:layout_height=\"fill_parent\" android:drawSelectorOnTop=\"true\" />

    <!-- Here is the view to show if the list is empty -->
    <TextView android:text=\"@string/empty_list_default_value\"
        android:id=\"@+id/txt_empty_list\" android:layout_width=\"fill_parent\"
        android:layout_height=\"fill_parent\" android:textSize=\"16sp\"
        android:textStyle=\"bold\" android:gravity=\"center\">
    </TextView>
</FrameLayout>
    </LinearLayout>
    

要回复问题请先登录注册