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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:32:21+00:00 2026-05-26T18:32:21+00:00

The problem I am facing is that I am unable to store the checked

  • 0

The problem I am facing is that I am unable to store the checked value of my checkbox

Here is my code:

  final Button markpresent = (Button) findViewById(R.id.Button01);
      markpresent.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) 
          {
              // Perform action on click
             Toast.makeText(display.this,"You have selected to mark the present students",Toast.LENGTH_SHORT).show();

             SparseBooleanArray checked = lView.getCheckedItemPositions();

               ArrayList<String> items = new ArrayList<String>();
               for (int i = 0; i < arr2.length; i++) 
               {
                   if (checked.get(i)) 
                   {
                       items.add(arr2[i]);
                       System.out.println(items);
                   }
               }

               Log.d("", "items:");
               for (String string : items)
               {
                   Log.d("", string);
                   System.out.println(items);
               }


          }
      });    

Only when the button is pressed , I want the values checked by the user to be stored in a String. However, my code isn’t working fine.

Here is logcat:

 11-09 15:52:09.678: WARN/ActivityManager(58): Activity idle timeout for HistoryRecord{44ffd9d0 com.example/.display}
 11-09 15:52:14.856: DEBUG/KeyguardViewMediator(58): pokeWakelock(5000)
 11-09 15:52:15.187: DEBUG/KeyguardViewMediator(58): pokeWakelock(5000)
 11-09 15:52:15.366: INFO/ActivityManager(58): Displayed activity com.example/.display: 16621 ms (total 16621 ms)
 11-09 15:52:15.746: INFO/ARMAssembler(58): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x33ab00:0x33ac0c] in 1153961 ns
 11-09 15:52:15.916: INFO/ARMAssembler(58): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x33ac10:0x33add8] in 921629 ns
 11-09 15:52:21.776: DEBUG/(276): items:
 11-09 15:52:28.086: WARN/KeyCharacterMap(276): No keyboard for id 0
 11-09 15:52:28.086: WARN/KeyCharacterMap(276): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
 11-09 15:52:28.296: WARN/InputManagerService(58): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@450bebc0 (uid=10060 pid=276)
 11-09 15:54:46.557: DEBUG/AndroidRuntime(293): Shutting down VM
  • 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-26T18:32:22+00:00Added an answer on May 26, 2026 at 6:32 pm

    store the value in sharedPreferences and when you need again just retrieve from sharedPreferences and do your task.

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

Sidebar

Related Questions

im facing a problem regarding my .htaccess file here is the code within the
I'm facing a really peculiar problem with my code, I am unable to push
I'm facing a problem that seems to have no straighforward solution. I'm using java.util.Map
I am facing the problem that I cannot properly map my foreign key table
I'm working with Eclipse and ClearCase and we're facing the problem that there's no
I'm facing a problem while unit testing my forms. The problem is that data
That was helpful kgiannakakis. I'm facing a problem as below: a = ['zbc','2.3'] for
I am new to Python and Numpy, and I am facing a problem, that
I'm facing a huge problem here which is driving me crazy, I've made an
Brand new to android and facing a weird problem.Check out the code below FirstActivity.java:

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.