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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:10:12+00:00 2026-05-23T18:10:12+00:00

Here is the code: public class beautiful extends Activity { ImageView radar = (ImageView)

  • 0

Here is the code:
public class beautiful extends Activity {
ImageView radar = (ImageView) findViewById(R.id.radar);

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
      this.requestWindowFeature(Window.FEATURE_NO_TITLE);
      this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.beautiful);

    Button search = (Button) findViewById(R.id.magnifier);
    ImageView text = (ImageView) findViewById(R.id.text);
    MediaPlayer siren = MediaPlayer.create(this, R.raw.siren);

    search.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Thread counter = new Thread(new Runnable(){

                @Override
                public void run() {
                    // TODO Auto-generated method stub
                    try{
                        Thread.sleep(2000);
                        radar.setImageResource(R.drawable.radar_new_full);
                        Thread.sleep(3000);
                        radar.setImageResource(R.drawable.radar_new_50);
                        Thread.sleep(2000);
                        radar.setImageResource(R.drawable.radar_new_found);
                    } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    finally{

                    }
                }

            });
            counter.start();
        }
    });
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // TODO Auto-generated method stub
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu, menu);
    return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    // TODO Auto-generated method stub
    switch(item.getItemId()){
    case R.id.new_search:
        startActivity(new Intent("com.zwiebel.MENU"));

    }
    return super.onMenuItemSelected(featureId, item);
}




}

And here is the layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#fccea8">

  <Button
        android:id="@+id/magnifier"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:layout_gravity="right"
        android:background="@drawable/searchmagnificer"
  />

  <ImageView
        android:id="@+id/radar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:paddingTop="5dp"
         />

  <ImageView
        android:id="@+id/text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        />
</LinearLayout>

I haven’t seen any problem in the code, so I don’t know what’s the error.

  • 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-23T18:10:13+00:00Added an answer on May 23, 2026 at 6:10 pm

    It’s pretty obvious. You are trying to find a view before the view has been set.

    ImageView radar = (ImageView) findViewById(R.id.radar);
    

    change that to

    ImageView radar;
    

    and put

    radar = (ImageView) findViewById(R.id.radar);
    

    below the setContentView function

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

Sidebar

Related Questions

Here's the code: public class MenuTabActivity extends TabActivity implements OnTabChangeListener{ @Override protected void onCreate(Bundle
here is my code: public class MainMenuActivity extends Activity implements OnClickListener { public int
Here is the code: public class BillingService extends Service implements ServiceConnection { ... @Override
Spinner is not working. Here is my code: public class second extends Activity{ Spinner
Here is a sample code: public class TestIO{ public static void main(String[] str){ TestIO
I have following code: public class readSensorsData extends Activity implements SensorListener { /** Called
Here is my code: public class TasksList extends ListActivity { ... private static final
Hi All I have the following code: enter code here public class XMPPClient extends
Here's my code: public class Game extends JComponent implements Runnable { World w =
Here is my code: public class Main { public static void main(String[] args) {

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.