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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:10:25+00:00 2026-06-13T16:10:25+00:00

In my Android application there is a view, ‘manage players’, and within that there

  • 0

In my Android application there is a view, ‘manage players’, and within that there is an ‘add player’ view. On the ‘add player’ view I am accessing the camera, so I have an override on onActivityResult. When it hits this, within the ‘manage players’ activity, the ‘add player’ view is now null. Here is a sample of the code:

public class ManagePlayersActivity {

    private AddPlayerView addPlayerView = null;
    private ManagePlayersView view;
    private Context context;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    context = this;

    view = ManagePlayersViewFactory.create(this);
    setContentView(view.asView());

        public void onEvent(ClickEvent event) {
            final Dialog d = new Dialog(context);
            ManagePlayersActivity.this.addPlayerView = AddPlayerViewFactory.create(context);

            ManagePlayersActivity.this.addPlayerView.setButtonPhotoPickerOnClickListener(new EventListener<ClickEvent>() {
                public void onEvent(ClickEvent event) {

                    ManagePlayersActivity.this.addPlayerView.setPlayerPhoto("Setting Photo");

                    PackageManager pm = context.getPackageManager();

                    if (pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {

                        Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                            startActivityForResult(cameraIntent, CAMERA_REQUEST);
                    }                   
                }

            });

            d.show();
        }
    });
}


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == CAMERA_REQUEST) {
        if (resultCode == RESULT_OK) {
            ManagePlayersActivity.this.addPlayerView.setPlayerPhoto("Photo set");
        } 
    }
}
}

So, after doing that the addPlayerView is null in the onActivity result. In honesty, I am very new to Android and Java, I am a c# web developer with no experience in MVC, so it could be a misunderstanding of how it fundamentally works. But, any help would be greatly appreciated!

Thanks,
Andy

  • 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-13T16:10:27+00:00Added an answer on June 13, 2026 at 4:10 pm

    Write this line above the event handler(i.e., outside onEvent()):

    ManagePlayersActivity.this.addPlayerView = AddPlayerViewFactory.create(context);

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

Sidebar

Related Questions

Is there an open source Android application that allows you to view the image
In my Android application, I have a simple list view with adapter. There's a
I have an android application. There are a lot of buttons in it but
Is there any way to add credit card payment support to an android application
I have a facebook login option in my android application. When there is no
In an Android application, similar to an application market, I have a Home view
In my android application I have to show the landscape view for large and
I have an Android application that generates some HTML which is rendered locally, in
i have problem using camera in my Android application i have a form for
In my android application there is a number of operations that the user can

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.