0

我正在使用sherlockListFragments显示来自 sqlite 数据库的列表。我想使用上下文操作栏从列表中删除项目列表。任何人都可以与我分享完成您已经知道的任务的步骤...

谢谢你的帮助..

4

1 回答 1

0

可以通过编码轻松完成

public void onActivityCreated(Bundle savedInstanceState) {





    TextView textView;
    Log.i("live", "onActivityCreated");
    super.onActivityCreated(savedInstanceState);
    mActionMode=null;

    setEmptyText("Loading...");


    myModeListener=new OnItemClickListener() {




        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position,
                long id) {

            pos[length]=position;




            mActionMode=getSherlockActivity().startActionMode(new mCallBack());
            Log.i("asa",Integer.toString(pos[length]));
            length++;




        }



    };




    myStocksadapter = new SimpleCursorAdapter(getActivity().getApplicationContext(),R.layout.delete, null, new String[] {DBConstants.NAME}, new int[] {android.R.id.text1},0);
    setListAdapter(myStocksadapter);
    mycontext=this;
    //textView=(TextView)findViewById(android.R.id.text1);

    getActivity().getSupportLoaderManager().initLoader(0, null, mycontext);

    Log.i("sss","before action bar");





}
于 2013-02-25T14:49:52.350 回答