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
Well, It feels like I hacked my way to get the information but it seems to work :p