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 7586053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:19:44+00:00 2026-05-30T19:19:44+00:00

In my program I get a number of strings from a remote SQL database

  • 0

In my program I get a number of strings from a remote SQL database using json. These items (strings) at the moment populate my Listview. I would like to put an edittext field in the listview if an item comes with both a string and an edittextfield. Later on I also want to save the text that is entered in the edittext field, so I need to be able to reference it. Can anyone help me out?

  • 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-05-30T19:19:47+00:00Added an answer on May 30, 2026 at 7:19 pm

    You should create a view for the list as you like it to be, here is example.

    home.xml

    <ListView
        android:id="@+id/listView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@android:drawable/alert_dark_frame" >
    </ListView>
    
    </LinearLayout>
    

    and one more xml which you have to inflate,
    list.xml

    <?xml version="1.0" encoding="utf-8"?>
    

    <TextView
        android:id="@+id/textView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Large Text"
        android:textAppearance="?android:attr/textAppearanceLarge" />
    
    <TextView
        android:id="@+id/textView2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    
        android:text="TextView" />
    
    </LinearLayout>
    

    in your activity use this method,

    LayoutInflater mlayoutinflator;
    public void getlist(final ArrayList<contact> list){
          // Get the list view
     ListView listView = (ListView) findViewById(R.id.listView);
        mlayoutinflator =(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        ArrayAdapter<contact> aa = new ArrayAdapter<contact>(this, R.layout.listitem,list){
            @Override
        public View getView(final int position, View convertView,ViewGroup parent) 
            {
    
                        if (null == convertView) 
                        {
            convertView = mlayoutinflator.inflate(R.layout.listitem, parent, false);
    
                holder = new ViewHolder();
                        holder.value1 = (TextView)convertView.findViewById(R.id.textView1);
                        holder.value2 = (TextView)convertView.findViewById(R.id.textView2);
                        convertView.setTag(holder);
                        }
                        else
                        {
                        holder = (ViewHolder) convertView.getTag();
                        }
                        holder.value1.setText(""+list.get(position).getName().trim());
                        holder.value2.setText(""+list.get(position).getNumber().trim());
    
    
                        convertView.setOnClickListener(new View.OnClickListener()
                        {
    
                            public void onClick(View v) 
                            {
                                Intent intent = new Intent(Intent.ACTION_VIEW);
                                intent.setData(Uri.parse("sms:"));
                                intent.putExtra( "sms_body", list.get(position).getName()+"-"+list.get(position).getNumber() );
                                startActivity(intent);
                            }
                        });
    
    
                return convertView;
            }
        };
        listView.setAdapter(aa);
    }
    
     static class ViewHolder
       {
           private TextView value1;
           private TextView value2;
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On Windows, how can my user-mode program get the driver version number(s) for the
I am using VB .NET to write a program that will get the words
I inherited a program which is using Windows Desktop Search (WDS) on a remote
I am trying to get a random string from a list of strings in
I am using MATLAB to process data from files. I am writing a program
Currently my program (see below) generates random strings (made of numbers) from 8 -
I'm writing a very simple program where I want to get user input from
In my simple OpenGL program I get the following error about exit redefinition: 1>c:\program
I'm trying to use rusage statistics in my program to get data similar to
I'm trying to get started with Hibernate, and when executing my program I get

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.