How do you include add, remove, and back buttons in ListActivity .pl?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can have your header/footer in a LinearLayout or RelativeLayout along with your ListView defined in XML, and pass it to setContentView; alternatively you can add a header or footer view programatically to your list view with addHeaderView or addFooterView. If that header/footer layout is a LinearLayout or RelativeLayout, you can jam your three buttons in that layout.
However, think if this is actually what you want to be doing from a UI standpoint. On Android (unlike the iPhone), the hardware “back” button usually functions as “back,” so you don’t really need an onscreen back button, for starters. And a “delete” button interaction would be fairly unpleasant (How do you select an item to be deleted? press delete, then select an item? That’s not going to be expected by Android users)… take your cues from the system apps like the Browser, just have a long-press context menu to delete items if needed (The exception: If deleting is a very common operation, use checkboxes for bulk operations a la the system GMail app).