Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
- Spinner displaying map of Class in prompt.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Re JMD  
View profile  
 More options Oct 14 2012, 12:09 pm
From: Re JMD <rjmdf...@gmail.com>
Date: Sun, 14 Oct 2012 13:07:09 -0300
Local: Sun, Oct 14 2012 12:07 pm
Subject: [android-developers] - Spinner displaying map of Class in prompt.

Guys,

I'm having a problem to show a Spinner, he display information of List
correct but the prompt and the item selected, not show correct, as you can
view in screen attached.

Action 1 - Prompt not correct
[image: Imagem inline 2]

Action 2 - List Correct
[image: Imagem inline 3]

Action 3 - iten select not display correct
[image: Imagem inline 4]

  image.png
95K Download

  image.png
303K Download

  image.png
114K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Re JMD  
View profile  
 More options Oct 15 2012, 8:27 am
From: Re JMD <rjmdf...@gmail.com>
Date: Mon, 15 Oct 2012 09:25:22 -0300
Local: Mon, Oct 15 2012 8:25 am
Subject: Re: [android-developers] - Spinner displaying map of Class in prompt.

Guys,

Any Ideia?

2012/10/14 Re JMD <rjmdf...@gmail.com>

  image.png
114K Download

  image.png
95K Download

  image.png
303K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Murphy  
View profile  
 More options Oct 15 2012, 8:38 am
From: Mark Murphy <mmur...@commonsware.com>
Date: Mon, 15 Oct 2012 08:34:13 -0400
Local: Mon, Oct 15 2012 8:34 am
Subject: Re: [android-developers] - Spinner displaying map of Class in prompt.

You neglected to post any code. Presumably, you are just passing an
ArrayList (or array) of some Java object to your SpinnerAdapter. You need
to override toString() on those objects to return what you want the
SpinnerAdapter to use, or make the change somewhere in your SpinnerAdapter
subclass itself (e.g., override getView() and getDropDownView() of an
ArrayAdapter).

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.2 Available!

  image.png
303K Download

  image.png
114K Download

  image.png
95K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Re JMD  
View profile  
 More options Oct 15 2012, 8:53 am
From: Re JMD <rjmdf...@gmail.com>
Date: Mon, 15 Oct 2012 09:51:40 -0300
Local: Mon, Oct 15 2012 8:51 am
Subject: Re: [android-developers] - Spinner displaying map of Class in prompt.

Mark,

For we have a view better, bellow the Sppiner Adapter and method that i
recover the ArrayList<Object>:

*Call Spinner:*

listaTpestabelecimento = getTpEstabelecimentoList(cd_objeto);
mySpinner = (Spinner) findViewById(R.id.SpinnerCustom);
myTextView = (TextView) findViewById(R.id.nomeObjeto);
 SpinnerAdapter myAdapter = new SpinnerAdapter(this,
android.R.layout.simple_spinner_item, listaTpestabelecimento);
mySpinner.setAdapter(myAdapter);

*Sppiner Adapter:*

public class SpinnerAdapter extends ArrayAdapter<Tpestabelecimento>
    {
        private Activity context;
        ArrayList<Tpestabelecimento> data = null;

        public SpinnerAdapter(Activity context, int resource,
ArrayList<Tpestabelecimento> data)
        {
            super(context, resource, data);
            this.context = context;
            this.data = data;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup
parent)
        {   // Ordinary view in Spinner, we use
android.R.layout.simple_spinner_item
            return super.getView(position, convertView, parent);
        }

        @Override
        public View getDropDownView(int position, View convertView,
ViewGroup parent)
        {   // This view starts when we click the spinner.
            View row = convertView;
            if(row == null)
            {
                LayoutInflater inflater = context.getLayoutInflater();
                row = inflater.inflate(R.layout.spinner_layout, parent,
false);
            }

            Tpestabelecimento item = data.get(position);

            if(item != null)
            {
                TextView nomeObjeto = (TextView)
row.findViewById(R.id.nomeObjeto);

                nomeObjeto.setText(item.getNome());

            }

            return row;
        }
    }

*Method return list:*

public ArrayList<Tpestabelecimento> getTpEstabelecimentoList(String
cd_tpestabelecimento) {

SoapObject request = new SoapObject(NAMESPACESOAP_ACTION1, METHOD_NAME4);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);

envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

try {

androidHttpTransport.call(SOAP_ACTION4, envelope);
SoapObject results = (SoapObject) envelope.getResponse();
 Log.e("Tpestabelecimento", results.toString());

int count = results.getPropertyCount();

for (int i = 0; i < count; i++) {

Tpestabelecimento tp = new Tpestabelecimento();

SoapObject obj = (SoapObject) results.getProperty(i);
 //SoapObject soRecipient = (SoapObject)
//obj.getProperty("tp_estabelecimento");

SoapPrimitive cd_tpestabelecimento_pr = (SoapPrimitive) obj
.getProperty("cd_tpestabelecimento");

SoapPrimitive nome_tpestabelecimento_pr = (SoapPrimitive) obj
.getProperty("ds_tpestabelecimento");

tp.setCd_tpestabelecimento(Integer.parseInt(cd_tpestabelecimento_pr
.toString()));
tp.setNome(nome_tpestabelecimento_pr.toString());

listaTpestabelecimento.add(tp);

}

 } catch (Exception e) {
e.printStackTrace();
}

return listaTpestabelecimento;

}

2012/10/15 Mark Murphy <mmur...@commonsware.com>

  image.png
303K Download

  image.png
95K Download

  image.png
114K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Re JMD  
View profile  
 More options Oct 15 2012, 10:08 pm
From: Re JMD <rjmdf...@gmail.com>
Date: Mon, 15 Oct 2012 23:06:00 -0300
Subject: Re: [android-developers] - Spinner displaying map of Class in prompt.

Mark,

You said that i should change the method .toString, but if i change this
method, i can't stored the SoapPrimitive, you will have a another solution?

2012/10/15 Re JMD <rjmdf...@gmail.com>

  image.png
303K Download

  image.png
95K Download

  image.png
114K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Re JMD  
View profile  
 More options Oct 17 2012, 9:51 am
From: Re JMD <rjmdf...@gmail.com>
Date: Wed, 17 Oct 2012 10:49:22 -0300
Local: Wed, Oct 17 2012 9:49 am
Subject: Re: [android-developers] - Spinner displaying map of Class in prompt.

any news guys?

2012/10/15 Re JMD <rjmdf...@gmail.com>

  image.png
114K Download

  image.png
95K Download

  image.png
303K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Anderson  
View profile  
 More options Oct 17 2012, 11:51 am
From: Justin Anderson <magouyaw...@gmail.com>
Date: Wed, 17 Oct 2012 09:44:56 -0600
Local: Wed, Oct 17 2012 11:44 am
Subject: Re: [android-developers] - Spinner displaying map of Class in prompt.

> You said that i should change the method .toString, but if i change this
> method, i can't stored the SoapPrimitive, you will have a another solution?

He gave you another solution when he said this:

or make the change somewhere in your SpinnerAdapter subclass itself (e.g.,

>> override getView() and getDropDownView() of an ArrayAdapter).

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware

  image.png
114K Download

  image.png
95K Download

  image.png
303K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Re JMD  
View profile  
 More options Oct 23 2012, 7:56 am
From: Re JMD <rjmdf...@gmail.com>
Date: Tue, 23 Oct 2012 09:54:09 -0200
Local: Tues, Oct 23 2012 7:54 am
Subject: Re: [android-developers] - Spinner displaying map of Class in prompt.

But i didn't know this solution, can you explain again?

2012/10/17 Justin Anderson <magouyaw...@gmail.com>

  image.png
95K Download

  image.png
303K Download

  image.png
114K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »