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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:23:09+00:00 2026-05-28T20:23:09+00:00

I have an android program. It has a button which when clicked is supposed

  • 0

I have an android program. It has a button which when clicked is supposed to open up a listview of various strings.

But the problem is, as soon as I click on the button, the listview opens up, but my original android program crashes. ( ListView is in another class which now begins to run).

            public void onClick(View v) {
                Intent intent = new Intent(v.getContext(), MemoryReader.class);
                startActivityForResult(intent, 0);
            }

This is the code snippet. What am I doing wrong?

Also, the thing I want is that I click on the button, a checkbox list opens up, I select various things and then come back to the original screen.

The idea I had right now was to implement a listview with checkboxes ( I read somewhere, this is possible) and then use the getAllCheckedOptions() function to retrieve whatever was checked.

IF there is a simpler way to tackle my problem, please point me to there.

Any help is much appreciated.

  • 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-28T20:23:10+00:00Added an answer on May 28, 2026 at 8:23 pm

    You are starting for a result without the possiblility to tell where the result is coming from. It is not good. Change 0 for smth else better.

    Here are some pieces of my working code that calls an activity for result:

    ————————————- PackVideo activity ————————————–

    calling for ServerSetActivity

    Intent serverSetIntent = new Intent();
    serverSetIntent.setClass(this, ServerSetActivity.class);
    startActivityForResult(serverSetIntent, CHANGE_IP);
    

    constants setting and result catching:
    (I have them together, because only here in catching both costants meet)

    static public int CHANGE_IP = 1000;
    static public int CHANGE_IP_DONE = 1001;
    
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        // If the request was for CHANGE_IP and the request was CHANGE_IP
        if (resultCode == CHANGE_IP_DONE && requestCode == CHANGE_IP) {
            readBaseInfoFromServer(getApplicationContext());
            startVideoPlayerService(getApplicationContext());
            setCurrentChannelAndPlay(getApplicationContext(), 0);
        }
    }
    

    ———————————– ServerSetActivity —————————————-

    ending of the called activity

    final Intent intent = new Intent();
    setResult(PackVideo.CHANGE_IP_DONE, intent);
    finish();
    

    Put here “onCreate” and both layouts of MemoryReader, please.

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

Sidebar

Related Questions

I have an android listview filled with items. Every item has a button. This
I have an Android program which has a RemoteService (different process) and the Application
I have a program that I'm writing in Android using Eclipse. It has an
Hi im new to android and I have a program that has a global
My program has been running fine, but I think I must have accidentally changed
I have Android pet-project DroidIn which utilizes HttpClient 4 (built into Android) to do
I have android.permission.READ_OWNER_DATA but I can't find any reliable code that would explain how
In my Android program, I have some code that downloads a file. This works
I'm doing some Android development, and I much prefer Visual Studio, but I'll have
So I ran into a problem today while working on my Android program. I

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.