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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:01:14+00:00 2026-06-08T14:01:14+00:00

In my application i am showing data from database in a listview.In that listview

  • 0

In my application i am showing data from database in a listview.In that listview 1 particular text view should be dynamic(i.e) based on one column value that particular textview should change,

Following are my full structure of database:

http://www.freeimagehosting.net/bmcrp
http://www.freeimagehosting.net/8f13z

.In that if reccurence is “true” means textview 9 should show recctotal otherwise total.

My code is as follows:

Cursor c = db.getExpensetitle(intent.getStringExtra("grpsdbexp"));
            startManagingCursor(c);     


                    -------------------->Here i have to use the condition.
                  from = new String[] {db.KEY_DATE,db.KEY_DESC,db.KEY_INCOME,db.KEY_QUANTITY,db.KEY_TOTAL,db.KEY_ROWID};
                  to = new int[] {R.id.text1 ,R.id.text3,R.id.text5,R.id.text7,R.id.text9,R.id.text11};


            SimpleCursorAdapter notes =
                            new SimpleCursorAdapter(this, R.layout.columnviewexp, c, from, to);             
            lv.setAdapter(notes);   

Please help me.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-06-08T14:01:22+00:00Added an answer on June 8, 2026 at 2:01 pm

    As there is a condition, you should custom cursor adapter instead of SimpleCursorAdapter.

    https://codereview.stackexchange.com/questions/1057/android-custom-cursoradapter-design

     SimpleCursorAdapter notes =
                                new SimpleCursorAdapter(this, R.layout.columnviewexp, c, from, to)
    {
          @Override
        public void bindView(View view, Context context, Cursor cursor) {
    
            boolean reurrence= cursor.getBoolean(cursor.getColumnIndex("recurrence"));
    
            TextView text9=(TextView)view.findViewById(R.id.text9);
    
            String text=null;
            if(recurrence)
                text=cursor.getString(cursor.getColumnIndex(KEY_TOTAL));
            else
                text=cursor.getString(cursor.getColumnIndex(KEY_REC_TOTAL));
    
             text9.setText(text);
    
            // Load remaining TextViews
    
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed an application that have a slider that showing some data from
I have a Silverlight navigation application, that for some reason when showing a data
Suppose I have a application which fetch data from network and then showing those
I did some research about showing the tables from my application database. all tutorials
In my applicatio i have 1 listview,filling data from database using arrayadapter. Here is
In my iPhone/iPad project, I'm showing some data from SQLite database. This database is
In my application I am getting data from server and showing it using a
From my iPhone application I'm outputting data from text to a file. When opened
i downloaded a demo application from http://code.msdn.microsoft.com/Authorization-based-aa2c0185/view/SourceCode I run it on my Visual Studio
I have to include one report in my application showing offline/online activity of few

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.