I'm working on a notepad app, and I'm having trouble with the context menus. The app has files/folders, so I have two separate context menus (one for files, one for folders). I got the menu to show for the right items by overriding the long-click listener, but it doesn't appear directly over the item; it appears like a dialog:
Here's the code for the long-click listener; I really feel like the problem is here; if not, I can post a little more:
override fun onItemLongClick(adapterView: AdapterView<*>?, p1: View?, pos: Int, p3: Long): Boolean {
val p : Int = adapterView?.getItemAtPosition(pos) as Int
currentFile = fileContents[p]
fileList.showContextMenu()
return true
}