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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:58:22+00:00 2026-06-16T18:58:22+00:00

I cannot seem to find out what this error means. Can you all help

  • 0

I cannot seem to find out what this error means. Can you all help me out?

Here is my source code in the MainView.java. After logging into the app, this is the first screen you see, it should show the header, then a google maps api, then the menu at the bottom.

public class MainView extends FragmentActivity implements OnClickListener {

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        return inflater.inflate(R.layout.main_view, container, false);
    }


    @Override
    protected void onStart() {
        // TODO Auto-generated method stub
        super.onStart();

        Fragment fragment;

        Button openDrawer = (Button) findViewById(R.id.openDrawer);
        openDrawer.setOnClickListener(this);

        Button openUploader = (Button) findViewById(R.id.menuButtonAdd);
        openUploader.setOnClickListener(this);
        Button openEditor = (Button) findViewById(R.id.menuButtonEdit);
        openEditor.setOnClickListener(this);
        Button openMap = (Button) findViewById(R.id.menuButtonMap);
        openMap.setOnClickListener(this);
        Button openPeople = (Button) findViewById(R.id.menuButtonPeople);
        openPeople.setOnClickListener(this);

        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();

        Map myFragment = new Map();
        ft.add(R.id.mainFragment, myFragment);
        ft.commit();
    }


    public void onClick(View arg0) {
        Fragment newFragment = new Map();

        switch (arg0.getId()) {
        case(R.id.openDrawer):
            SlidingDrawer menuDrawer = (SlidingDrawer) findViewById(R.id.menuDrawer);
            //SlidingDrawer textDrawer = (SlidingDrawer) findViewById(R.id.textDrawer);
            if (menuDrawer.isOpened() == true) {
                menuDrawer.animateClose();
                //textDrawer.animateClose();
            } else if (menuDrawer.isOpened() == false) {
                menuDrawer.animateOpen();
                //textDrawer.animateOpen();
            }
            break;
        case(R.id.menuButtonAdd):
            newFragment = new UploadFragment();
            break;
        case(R.id.menuButtonEdit):
            newFragment = new EditGallery();
            break;
        case(R.id.menuButtonMap):
            newFragment = new Map();
            break;
        case(R.id.menuButtonPeople):
            // TODO present an error
            break;
        default:
            newFragment = new Map();
            break;
        }

        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.replace(R.id.mainFragment, newFragment);
        transaction.commit();
    }
}

Code at line 37:

openDrawer.setOnClickListener(this);
  • 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-16T18:58:23+00:00Added an answer on June 16, 2026 at 6:58 pm

    It means you’ve got a NullPointerException on this line: com.fotolife.app.MainView.onStart(MainView.java:37)

    This is because openDrawer is null, because it cannot be found in the view.

    You need to add this:

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_view);
    }
    

    and remove the onCreateView method.

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

Sidebar

Related Questions

i cannot seem to find the answer to this. i uploaded code to pastebin
I cannot seem to find the answer to this I am looking for a
I am stuck on this issue and cannot seem to find a way around
I researched this question for days and cannot seem to find an option I
I have been researching this issue pretty extensively and cannot seem to find an
I'm sure this is a very simple fix but I cannot seem to find
I am new to Scala, and I cannot seem to find this information. Currently
I have a weird error that I cannot seem to find any documentation or
This feels like a newbie issue, but I can't seem to figure it out.
I cannot seem to find out why IE does not read my success on

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.