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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:40:41+00:00 2026-05-27T16:40:41+00:00

My Application has like below functionality: I have Done to set the Values with

  • 0

My Application has like below functionality:

See Image

I have Done to set the Values with the custom adapter. but now i want to implement the functionality as like add another data, delete showing data, go to next data and back to previous data. In all that functionality only the Blue Values should be change. (that is the orderStatus in code). Left One Value (orderName()) should remain the same. Then how to implement that ?

If i am adding the new data then that should be temporary stored as i want to show that data in to report.

In My Application i am going to add data first time AS like below code:

getOrder function to set the Value of the OrderName and OrderStatus.

    public void getOrders(){
        try{
//              if(employee)
//              {
                    System.out.println("You are in Employee");
                    m_orders = new ArrayList<Order>();
                    payListForEmployee = new String[] {"Tax Code","Pay period Begin","Pay Frequency","Salary/Wage per pay",
                        "Net or Gross Amount","KS Employee deduction","KS Employee contributions","Child Support deduction","Payroll giving donation"};

                    Order o[]=new Order[payListForEmployee.length];
                    System.out.println("The Length is: "+payListForEmployee.length);
                    for (int i = 0; i < payListForEmployee.length; i++) 
                    {
                        o[i]=new Order();
                        o[i].setOrderName(payListForEmployee[i]);

                        //myPrefs = this.getSharedPreferences("myPrefs", MODE_WORLD_READABLE);
                        // for TAXCODE
                        if(i==0) {
                            taxCodeValue = PAYEEmployeeDetail.taxCodeFinalValue;
                            if((taxCodeValue==null)) {
                                taxCodeValue = "Please select";
                            }
                            o[i].setOrderStatus(taxCodeValue);
                            //System.out.println("The Value is: "+o[i].getOrderStatus());

                        }
                        // for Pay Period Frequency
                        if(i==1) {
                            //payPeriodValue = myPrefs.getString("payperiod", "12 09 2011");
                            payPeriodValue =  PAYEEmployeeDetail.payPeriodFinalValue;
                            if((payPeriodValue==null)) {
                                payPeriodValue = "--/--/----";
                            }
                            o[i].setOrderStatus(payPeriodValue);
                            //System.out.println("The Value is: "+o[i].getOrderStatus());
                        }
                        // for Pay frequency
                        if(i==2) {
                            //payFrequencyValue = myPrefs.getString("payfrequency", "Weekly");
                            payFrequencyValue =  PAYEEmployeeDetail.payFrequencyFinalValue;
                            if((payFrequencyValue==null)) {
                                payFrequencyValue = "Please select";
                            }
                            o[i].setOrderStatus(payFrequencyValue);
                            //System.out.println("The Value is: "+o[i].getOrderStatus());
                        }
                        // for salary / wage
                        if(i==3) {
                            salaryWageValue =  PAYEEmployeeDetail.salaryWageFinalValue;
                            if((salaryWageValue==null)||(salaryWageValue.equals(""))) {
                                salaryWageValue = "$0";
                            }
                            else{
                                salaryWageValue = "$"+salaryWageValue;
                            }
                            o[i].setOrderStatus(salaryWageValue);
                            //System.out.println("The Value is: "+o[i].getOrderStatus());
                        }
                        // For Gross / Net
                        if(i==4) {

                            o[i].setOrderStatus("Gross");
                            //System.out.println("The Value is: "+o[i].getOrderStatus());
                        }
                        // for KS Employee Deduction
                        if(i==5) {
                            employeeDeductionValue =  PAYEEmployeeDetail.employeeDeductionFinalValue;
                            if((employeeDeductionValue==null)||(employeeDeductionValue.equals(""))) {
                                employeeDeductionValue = "0%";
                            }
                            o[i].setOrderStatus(employeeDeductionValue);
                            //System.out.println("The Value is: "+o[i].getOrderStatus());
                        }
                        // for KS Employee Contribution
                        if(i==6) {
                            employeeContributionValue =  PAYEEmployeeDetail.employeeContributionFinalValue;
                            if((employeeContributionValue==null)||(employeeContributionValue.equals(""))) {
                                employeeContributionValue = "0%";
                            }
                            else{
                                employeeContributionValue = employeeContributionValue+"%";
                            }
                            o[i].setOrderStatus(employeeContributionValue);
                            //System.out.println("The Value is: "+o[i].getOrderStatus());
                        }
                        // for Child Support Deduction
                        if(i==7) {
                            childSupportDeductionValue =  PAYEEmployeeDetail.childSupportDeductionFinalValue;
                            if((childSupportDeductionValue==null)||(childSupportDeductionValue.equals(""))) {
                                childSupportDeductionValue = "$0";
                            }
                            else{
                                childSupportDeductionValue = "$"+childSupportDeductionValue;
                            }
                            o[i].setOrderStatus(childSupportDeductionValue);
                            //System.out.println("The Value is: "+o[i].getOrderStatus());
                        }
                        // for Payroll giving donation
                        if(i==8) {
                            payrollDonationValue =  PAYEEmployeeDetail.payrollDonationFinalValue;
                            if((payrollDonationValue==null)||(payrollDonationValue.equals(""))) {
                                payrollDonationValue = "$0";
                            }
                            else{
                                payrollDonationValue = "$"+payrollDonationValue;
                            }
                            o[i].setOrderStatus(payrollDonationValue);
                            //System.out.println("The Value is: "+o[i].getOrderStatus());
                        }
                        m_orders.add(o[i]);
                        //lv.invalidate();
//                      System.out.println("==> TaXCode Value: "+PAYEEmployeeDetail.taxCodeFinalValue);
//                      System.out.println("==> PAyPeriod Value: "+PAYEEmployeeDetail.payPeriodFinalValue);
//                      System.out.println("==> PayFrequency Value: "+PAYEEmployeeDetail.payFrequencyFinalValue);
//                      System.out.println("==> Salary/Wage Value: "+PAYEEmployeeDetail.salaryWageFinalValue);
//                      System.out.println("==> Gross/Net Value "+"STATIC VALUE = GROSS");
//                      System.out.println("==> Employee Deduction Value "+PAYEEmployeeDetail.employeeDeductionFinalValue);
//                      System.out.println("==> Employee Contribution Value "+PAYEEmployeeDetail.employeeContributionFinalValue);
//                      System.out.println("==> Child Support Deduction Value "+PAYEEmployeeDetail.childSupportDeductionFinalValue);
//                      System.out.println("==> PayRoll Donation Value "+PAYEEmployeeDetail.payrollDonationFinalValue);
//                      
                    }
//              }
//              else
//              {
//                  System.out.println("You Are in Employer");
//                  m_orders = new ArrayList<Order>();
//                  
//                  payListForEmployer = new String[] {"Tax Code","Pay period Begin","Pay Frequency","Salary/Wage per pay",
//                          "Net or Gross Amount","KiwiSaver Member","Employee Deduction","Employee Contributions",
//                          "Complying Fund Member","Fund Contribution","ESCT Tax Rate","Child Support Deduction","Payroll giving donation"};
//                  
//                  System.out.println("The Length is: "+payListForEmployer.length);
//                  
//                  Order o[]=new Order[payListForEmployer.length];
//                  for (int i = 0; i < payListForEmployer.length; i++) 
//                  {
//                      o[i]=new Order();
//                      o[i].setOrderName(payListForEmployer[i]);
//                      o[i].setOrderStatus("Pending");
//                      m_orders.add(o[i]);
//                  }
//              }

                Thread.sleep(100);
                Log.i("ARRAY", ""+ m_orders.size());
            } catch (Exception e) { 
                e.printStackTrace();
         }
         runOnUiThread(returnRes);
    }
private Runnable returnRes = new Runnable() {

        @Override
        public void run() {
            if(m_orders != null && m_orders.size() > 0){

                m_adapter.notifyDataSetChanged();
                for(int i=0;i<m_orders.size();i++)
                    m_adapter.add(m_orders.get(i));
            }
           // m_ProgressDialog.dismiss();
            m_adapter.notifyDataSetChanged();
        }
};

And Creating and calling the thread like this:

 viewOrders = new Runnable(){
        @Override
        public void run() {
            getOrders();
        }
    };

    thread =  new Thread(null, viewOrders, "MagentoBackground");
    thread.start();

So Will please help me to give logic for that or give some code that can help me in this to implement that functionality.
Thanks.

  • 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-27T16:40:41+00:00Added an answer on May 27, 2026 at 4:40 pm

    On the basis of your question

    I have Done to set the Values with the custom adapter. but now i want
    to implement the functionality as like add another data, delete
    showing data, go to next data and back to previous data. In all that
    functionality only the Blue Values should be change. (that is the
    orderStatus in code). Left One Value (orderName()) should remain the
    same. Then how to implement that ?

    Here is my answer in few steps and assuming that you are passing your list values in var ‘A’:

    1. You should extend BaseAdapter in your custom adapter of the list.

    2. Set your initial values to A and pass it to the adapter and set it to the listview.

    3. Now if you want to add some more values then add it in your var A and call the notifyDataSetChanged() which will reflect your new values to the list.

    4. If you want to show next values then also set the appropriate values in A and call notifyDataSetChanged().

    5. If you want to delete then setOnItemClickListener() to your list and on click remove the values from the A and call notifyDataSetChanged().

    Note: To save the list values you can use SQLite. You can follow this tutorial over lisview.

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

Sidebar

Related Questions

I have a sample application which has something like below. <a href=javascript:{} id=anchorlnk>Go</a> which
I have built a Java application that has some dependencies (~10). I would like
In my application I have a class which has properties of user-defined types like
I have a Spring application that I believe has some bottlenecks, so I'd like
I have a particular web application that like most others, has to account for
I have a cocoa application that has a finder like feel it and is
I have a c# windows form application that has a similar GUI functionality as
My application has a header (like toolbar) which contains some button controllers,and just below
I have the configuration details of my application stored in a table like below
I would like to create a UIBarButtonItem on my iPhone application which has two

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.