Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4067182
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:13:04+00:00 2026-05-20T16:13:04+00:00

I have a listview which displays emails with the following layout: email@address.com category //This

  • 0

I have a listview which displays emails with the following layout:

email@address.com                            category  //This could be work etc
First line of the emails subject!

Using the following XML:

<LinearLayout 
 ........
 android:orientation="vertical">     
<LinearLayout       
 ........    
 android:orientation="horizontal">       
     <TextView android:id="@+id/FROM_CELL"
         android:layout_width="250dip"
         android:layout_height="wrap_content" android:textColor="#AFC7C7" android:textSize="9sp"/> 
     <TextView android:id="@+id/CATEGORY_CELL"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content" android:textColor="#34282C" android:textSize="9sp" android:gravity="right" />   
</LinearLayout>  
 <TextView android:id="@+id/SUBJECT_CELL"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content" android:textColor="#FFFFFF" android:textSize="10sp"/>

This all works fine, but when I put a ContextMenu on so I can allow long presses on certain emails, how would I go about retrieving the email address as to assign it a category?

On the database side my method takes 2 strings, 1 being the email address to assign a category and another string which is what to call the category.

I was wondering how you go about retrieving the email in the onContextItemSelected() method to allow for me to use it for assigning category’s.

Sorry if this is a bad explanation, I have tried my best 🙂

Thanks,
Rhys

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:13:05+00:00Added an answer on May 20, 2026 at 4:13 pm

    Well, It feels like I hacked my way to get the information but it seems to work :p

    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
    Object id = list.getItemAtPosition((int) info.id);
    String row = id.toString();
    String address = row.substring(row.indexOf("From=")+5, row.length()-1); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView which contains custom rows. This custom row has following UI
I have a listview, which displays a list of administrators, this list is held
I have the following window, which displays a listview. I defined a style for
This is a very common scenario: displaying images in a ListView which have to
I have the following ListView in which I am using the JQuery UI sortable
I have a ListView which displays information about some entities (all of the same
I have a list (ListView) which which displays a lot of information, and what
I have a listview which displays a lot of info, but when it's empty
I have a listview which displays items retrieved from the webpage. Each item in
I have created a listview which displays all the people in the database. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.