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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:12:44+00:00 2026-05-29T16:12:44+00:00

In the eclipse/android AVD, I get Unfortunately, has stopped I have checked other Qs

  • 0

In the eclipse/android AVD, I get “Unfortunately, has stopped”

I have checked other Qs about this, but none helped.

I assume it is my code that is faulty, because when I comment the code out, it runs fine. However, the android code-checker thingy shows no errors.

This is my code:

public TextView TextView;

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

public void setTextView(){
    TextView tv = (TextView);
    findViewById(R.id.textView1); 
    tv.setText("4");
}

I tried this aswell, but the same happened

public TextView TextView;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    TextView tv = (TextView);
    findViewById(R.id.textView1); 
    tv.setText("4"); 
}

I’m not sure whether the structure of my code is correct either.

  • 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-29T16:12:44+00:00Added an answer on May 29, 2026 at 4:12 pm
     TextView tv = (TextView);
    

    Makes tv as null and when you do tv.set... it throws NullPointerException.

    Try below code.

      TextView tv = (TextView)findViewById(R.id.textView1); 
        tv.setText("4"); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android project and Eclipse is telling me my project has an
I'm brand new to Android dev and have some n00b questions about AVD. Is
I'm new to Java/Eclipse/Android, so this is probably an easy (if not stupid) question:
Possible Duplicate: NoClassDefFoundError - Eclipse and Android I'm seeing this question is getting asked
Eclipse is complaining about my Android project saying all my references to resources are
I know that eclipse can do this, can Intellij via the new Android support
I run my app in the AVD emulator using eclipse but I'm unable to
In Eclipse I check for available Android packages, at Window->Android SDK and AVD Manager
I used to have some experience with developing for android but I started up
When i try to launch the android emulator from the avd manager this error

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.