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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:29:03+00:00 2026-05-25T17:29:03+00:00

So basically the screen has a GridView with 9 images on it. When one

  • 0

So basically the screen has a GridView with 9 images on it. When one of those images clicks I have it setContentView to open a layout of just an image view so it displays the chosen image. After they are done with that image they will click back and it gets rid of that contentView and displays the GridView again. The majority of that works except for it using the ImageView in the other contentView.

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setView();
    setContentView(R.layout.wall);


    GridView gridview = (GridView) findViewById(R.id.gridview);
    gridview.setAdapter(new ImageAdapter(this));

    gridview.setOnItemClickListener(new OnItemClickListener() {
       @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int position,
                long arg3) {
            pos = position;
            displayWallpaper();


        }
    });
}

private void displayWallpaper(){
        switch(pos){
        case 0: 
            setContentView(R.layout.wallpaper);
            viewing=true;
        ImageView image1 = (ImageView)findViewById(R.id.display);
        rotate(R.drawable.wallpaper1, image1);
            break;
}
}

So the force close is happening at the ImageView line. And my guess is it isn’t finding display, but display is in the wallpaper layout. Any ideas why it may be force closing. If you need more info let me know what and if you have a better way of doing what I am trying to make happen let me know. Thanks.

Also just tested it out. So far the force close still happens if rotate() is commented out and ImageView is there. If I comment both out it works fine (apart from displaying the image).

  • 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-25T17:29:04+00:00Added an answer on May 25, 2026 at 5:29 pm

    Your Image View image1 was not existing in the layout you specifed i.e in display layout…

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

Sidebar

Related Questions

I basically have a page which shows a processing screen which has been flushed
I am trying to implement a popup screen(basically for EULA screen) which has one
I have a full screen UIScrollView that has several possible layout configurations. It is
I have a scene in andEngine. The scene has basically three animated objects. I
I have a WPF app which snaps to screen edges (I just set the
I have a set of 12 images to show in a layout. The number
So right now one of my layouts has a table image set as a
I have an App that has a toolbar at the bottom of the screen
I have been searching everywhere and nothing so far has worked for me. Basically
So I have the following code which i basically just a JSON string 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.