• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

ListView Problem

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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.

Please I am stuck up here since 3 days.

Thank you
 
Ranch Hand
Posts: 231
Android IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you post up some of your code so we can see what you are doing?
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you have so far? What does your layout look like, particularly its XML definition?
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 127
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked at API demo supplied with Android SDK ? please go through API Demos and there are 6-7 examples of ListActivities.

There is one example in API Demo for list activity that will solve you problems, it shows how to create customized Adapter.

hope this helps.. write back to forum if problem remains..

Regards,
Piyush

 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic