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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:20:21+00:00 2026-05-23T00:20:21+00:00

I want to show setName column as a list view how it is possible

  • 0

I want to show setName column as a list view how it is possible in android.
I am share my code.

private String lv_arr[];
String selectList = "select setName from Displaysettings";      
DBConnect conn1 = new DBConnect(getApplicationContext(), "colorCode");      
conn1.execNonQuery(selectList);
lv1=(ListView)findViewById(R.id.ListView01);
lv1.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 , lv_arr));

thanks in advance.

  • 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-23T00:20:22+00:00Added an answer on May 23, 2026 at 12:20 am

    you can try something like this:

    String[] setNameValues = new String[] {
                "setName1",
                "setName2",
                "setName3"
        };
    
        // Create a simple array adapter (of type string) 
        //with the setName values returned by conn1.execNonquery
        ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, setNameValues);
    

    So, you should convert your conn1.execNonQuery(selectList) result to a string array

    Update:

    Or you can use a cursor adapter, if your conn1.execNonQuery return a cursor.

    For example (some lines are delete to make it clear)

    public class DiagramListCursorAdapter extends CursorAdapter {
    
        private boolean dataValid;
        private boolean autoRequery;
        private boolean autoRequeryInProgress;
        private int count = -1;
    
        public DiagramListCursorAdapter(Context context, Cursor c, boolean autorequery) {
            super(context, c, autorequery);
        }
    
        @Override
        public View newView(final Context context, Cursor cursor, ViewGroup parent) {
            LayoutInflater inflater = LayoutInflater.from(context);
            View v = inflater.inflate(R.layout.diagram_item, null);
            DiagramListCursorWrapper wrapper;
            wrapper = new DiagramListCursorWrapper(v);
            v.setTag(wrapper);
            return v;
        }
    
        @Override
        public void bindView(View v, Context context, Cursor cursor) {
            DiagramListCursorWrapper wrapper = (DiagramListCursorWrapper) v.getTag();
            wrapper.populateFrom(cursor);
        }
    
        void refresh() {
            if (getCursor() != null) {
                getCursor().requery();
            }
        }
    
    
        public class DiagramListCursorWrapper {
            TextView title;
    
            public DiagramListCursorWrapper(View v) {
                setupViews(v, null);
            }
    
            public DiagramListCursorWrapper(View v, Context context) {
                setupViews(v, context);
            }
    
            private void setupViews(View v, Context context) {
                title = (TextView) v.findViewById(R.id.title);
                icon = (ImageView) v.findViewById(R.id.icon);
    
            }
    
            public void populateFrom(Cursor cursor) {
                if (cursor != null) {
                    try {
                        title.setText(cursor.getString(cursor.getColumnIndex(DiagramsADO.DIAGRAM_TITLE)));
                    } catch (Exception e) {
                    }
                }
    
            }
    
        }
    
    }
    

    I hope this helps you

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

Sidebar

Related Questions

i want to hide and show my text box according to drop down select
I have two overlay images that I want show in camera view depending on
I want the messagebox to only show if the number is equal to 0.
If all tables I want to delete from have the column gamer_id can i
I want show a web page (google) when i click on the button in
I have saved same image into /data/data/mypackage/img/ and now I want show this full
I have a little Problem with a MDX-Query . I want show all the
I have a paragraph <p>hello<br>wor&nbsp;l&nbsp;d</p> then I want show the paragraph's html in another
I want to use a temp directory that will be unique to this build.
I want to get the header of a selected tab-item of a tab-control and

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.