Advice needed with context menu

前端 未结 2 1214
抹茶落季
抹茶落季 2021-01-29 05:59

I have a XML layout which has two edit text fields, one for \"title\" and the the other for \"story\". When the user enters his data in these text fields and presses the back b

相关标签:
2条回答
  • 2021-01-29 06:03

    I would think the best way to do this is to create an instance variable (declared after class definition and before onCreate) for the listview and assign the list view to it in onCreate(). Then you will be able to access the listview from your onContextItemSelected() method and pass them to your new activity

    If you could post some of your code we should be able to help more.

    I second Th0rndike's comments above. It is much easier to help someone if the question is readable and there is a good chance the answer will be accepted.

    0 讨论(0)
  • 2021-01-29 06:07

    in adapter you make a getter and setter of your item. When long click listener, put setter your item in there.

    You should store your "title" and "story" in database and you can get it form database in a new activity

    0 讨论(0)
提交回复
热议问题