小编Emi*_*mil的帖子

没有为我的微调器调用OnItemSelectedListener()

嗨,我有一个使用visibility = gone atribute隐藏的微调器.我使用spinner.performclick()调用微调器列表,这个工作正常,除了在微调器列表中选择一个项目时,我的onselect监听器永远不会被调用.请帮忙:)

被抛出的唯一catlog警告是"窗口已经集中,忽略焦点增益"

        catagorySpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
        @Override
        public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
            CashDB cdb = new CashDB(getBaseContext()); 
            cdb.open();
            Cursor c = cdb.FetchCatagory(id);
            startManagingCursor(c);
            c.moveToFirst();
            String newCatagoryName = c.getString(c.getColumnIndexOrThrow(CashDB.CATAGORY_NAME));
            c.close();
            areYouSureDialog("Are You Sure?", "Are you sure you want to delete the catagory " +'"' 
                    + catagoryName + '"'+ " and move all of the transactions to " +'"' 
                    + newCatagoryName + '"' + " ?",
                    catagoryIcon, catagoryName,newCatagoryName, DELETE_CATAGORY_MOVE, catagoryId);
        }

        @Override
        public void …
Run Code Online (Sandbox Code Playgroud)

android selection spinner

2
推荐指数
1
解决办法
3508
查看次数

标签 统计

android ×1

selection ×1

spinner ×1