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
Message from discussion - Spinner displaying map of Class in prompt.
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 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>

> 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>

>> 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>

>>> 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).

>>> On Mon, Oct 15, 2012 at 8:25 AM, Re JMD <rjmdf...@gmail.com> wrote:

>>>>  Guys,

>>>> Any Ideia?

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

>>>>> 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]

>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Android Developers" group.
>>>> To post to this group, send email to
>>>> android-developers@googlegroups.com
>>>> To unsubscribe from this group, send email to
>>>> android-developers+unsubscribe@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/android-developers?hl=en

>>> --
>>> 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!

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-developers+unsubscribe@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en

  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.