Search code examples
androiddebuggingandroid-loadermanagerandroid-cursorandroid-cursorloader

How to access getLoaderManager() inside a setOnItemClickListener() overriding an onItemClick()?


So I am stuck on how to access my getLoadManager from within that scope. All I really want to do is refresh the cursor since the LoaderManager is already created before it reaches that point, but I don't really now how to accomplish that besides calling getLoaderManager(). Problem is I can't in that scope. Any ideas? thanks in advance.

calendar.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            /*Stuff thats not really important to show*/

        }
    });

Solution

  • You can use,

    ActivityName.this.getLoaderManager();