Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8017631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:54:04+00:00 2026-06-04T20:54:04+00:00

i wanted to returned the selected value from the listview, i can do it

  • 0

i wanted to returned the selected value from the listview, i can do it if i using the default listview, but now i customize the listview, got imageview, ratingbarm and few textview. how can i return the value of title at the toast after user has selected? below is my code:

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.appslist);

        list=(ListView)findViewById(R.id.lvApps);        


        SoapObject Request = new SoapObject (NAMESPACE, METHOD_NAME);
    SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

        soapEnvelope.dotNet = true;
        soapEnvelope.setOutputSoapObject(Request);

        AndroidHttpTransport aht = new AndroidHttpTransport(URL);

        try
        {
            aht.call(SOAP_ACTION, soapEnvelope);
            SoapObject resultString = (SoapObject) soapEnvelope.getResponse();          

            String[] strTitle = new String[resultString.getPropertyCount()];
            String[] strDeveloper = new String[resultString.getPropertyCount()];
            String[] strRating = new String[resultString.getPropertyCount()];
            String[] strLogo = new String[resultString.getPropertyCount()];         

            for(int i =0; i<resultString.getPropertyCount(); i++)
            {
                SoapObject array = (SoapObject) resultString .getProperty(i);
                strTitle[i] = array.getProperty(1).toString();  //get title  
                strDeveloper[i] = array.getProperty(3).toString(); //get developer
                strRating[i] = array.getProperty(4).toString(); //get rating
                strLogo[i] = array.getProperty(5).toString();   //get photo             
            }
            adapter=new AppsListAdapter(this, strTitle, strDeveloper, strRating, strLogo);
            list.setAdapter(adapter);

            list.setOnItemClickListener(new OnItemClickListener(){
                @Override
                public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
                    Object GetLabel = list.getItemAtPosition(arg2);
                          //Toast here
                    Toast.makeText(getApplicationContext(), GetLabel.toString(), Toast.LENGTH_SHORT).show();                        

            });
        }

        catch(Exception e)
        {

        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:54:05+00:00Added an answer on June 4, 2026 at 8:54 pm

    You should create model (bean) of all the data in one item means wrap the data in objects and create the array of that models and send that array to adapter……….

    But for now there a few ways to acive you task :

    1- you have the position of selected item which can be used as index in the strTitle to get the particular title.

    String title = strTitle[position]; /// if think can Put the null and length check if to make it safe

    2- you have the view of the list in callback public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) from that view using findViewbyid you can get your textview having title

    String s =(String) ((TextView) view.findViewById(R.id.title)).getText(); //view is selected row view

    or

    TextView txt =(TextView)arg0.getChildAt(position-lv.firstVisiblePosition()).findViewById(R.id.mylistviewtextview); //arg0 is parent view
    String keyword = txt.getText().toString();

    3-

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to write something basic in assembly under Windows. I'm using NASM, but
when i try to parse the response returned from a web service i got
Look at this simple query SELECT id FROM users Now, say I wanted to
I can certainly do this by iterating through results with PHP, but just wanted
Using NSJSONSerialization on a returned NSData from a network call I get back a
Just wanted to know if anyone is really using Objects and Collections in Oracle
I wanted to implement python com server using win32com extensions. Then consume the server
I wanted to pull an arbitrary number of random elements from an array in
Is it possible for a user to forge the result that is returned from
How can I send and receive multiple inputs using Runtime.getRunTime.exec(). For example if I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.