I am making an application in which user can configure their mail accounts.
I am able to retrieve mails from mail server.But the problem is with view.I am using SimpleAdapter to display the content.It works fine when there is only text content.
What I want to do is when mail has an attachment, I want to display an icon instead of text.Now this creates problem because I have used Arraylist to pass the argument in SimpleAdapter.
Is there any one who has solution of this.
If question is not clear to anyone they can ask for more.
James Elsey wrote:can you post up some of your code so we can see what you are doing?
I have not started the code because I have no idea from where I should start
I know how to do mapping between data and fields (i.e from and to) in SimpleAdapter but what about images.
OK,you must have seen Email application given with android SDK preinstalled.When you view your inbox your mails are listed.I want to prepare same kind of view.
But for your reference I am giving image.
I want to prepare above kind of view.But with the SimpleAdapter
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
0
The SimpleAdapter javadocs talk of either a boolean, a string or an image, not of combinations thereof (which is probably what makes it "Simple"). You'll probably have to use an ArrayAdapter, or subclass it.
Hardik Trivedi
Ranch Hand
Joined: Jan 30, 2010
Posts: 252
posted
0
Hi, first of all thank you for the reply.
I refer some example of ArrayAdapter but still can not make it out.
Can you share some demo code?
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
0
What do you have so far? What does your layout look like, particularly its XML definition?
Hardik Trivedi
Ranch Hand
Joined: Jan 30, 2010
Posts: 252
posted
0
This is how my xml looks like.
It is not similar to above given image.I have removed some content.I will add them later.The ImageView tag I have taken to display attachment icon.