Popup Menu in custom ListView

前端 未结 7 1484
礼貌的吻别
礼貌的吻别 2020-12-05 11:44

What I want to achieve:

I have a custom ListView adapter. To each Listitem I want to add a popup menu, pretty similar to the ListView in the current Google Play appl

7条回答
  •  甜味超标
    2020-12-05 12:22

    I finally found the solution to my problem, eventhough I have no explanation why this solution works.

    With the following import I always had the error:

    import android.support.v7.widget.PopupMenu;
    

    It works fine with the following import:

    import android.widget.PopupMenu;
    

    I tested the code provided by Ric (Thanks for the great help!) and my own. Both are working now. Maybe someone has an explanation why the import matters in this case.

提交回复
热议问题