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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:16:21+00:00 2026-05-30T00:16:21+00:00

I am very new to Android development. I have this code: Button btnLaunch; btnLaunch=(Button)findViewById(R.id.btnLaunch);

  • 0

I am very new to Android development. I have this code:

Button btnLaunch;
btnLaunch=(Button)findViewById(R.id.btnLaunch);

and I have these imports:

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

But my Eclipse is highlighting the “btnLaunch” in red. Why is that? Should I manually edit one of the configuration XML files to let the system know about btnLaunch? How is it meant to work?

Also, when I try to create an Intent like this:

      Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);
      CurrentActivity.this.startActivity(myIntent);

The CurrentActivity and NextActivity are not recognized, and the autoComplete does not offer me to import those. Am I missing a package?

  • 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-30T00:16:22+00:00Added an answer on May 30, 2026 at 12:16 am

    Which btnLaunch? You have 2, one is button, and the other is in integer. My guess (from the limited amount of code you put up) is you did not declare an ID for your button. Am I right in guessing the error highlighted is related to finViewById(R.id.btnLaunch

    The button declaration shoud look something like:

    <Button
        android:id="@+id/btnLaunch"
        .
        .
        . />
    

    Whenever you are trying to reference soemthing declared in an XML file, you have to pay attention to the ID’s. On a related note, if there is a problem with the XML file, Eclipse will not generate your R.java file, so also make sure there are no errors in the XML.

    For the second part, in the Project folder, there is a file called Manifest.xml, in there, all the Activities used by your application need to be listed there. If you have added Activties after creating the project, you will have add their entry manually. It would look somethig like:

    <acitvity
        name=".MyActivity" />
    

    There are different attributes you could add, based on your specific needs, but is the basic set up.

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

Sidebar

Related Questions

I am very new to android development.... i have created an app and want
Doing Android development on a Mac and this very new phone I have doesn't
I'm very new on Android development. I have this: AlertDialog.Builder builder = new AlertDialog.Builder(this);
I am very new to android development and have been trying to draw a
I have been slowing learning and building my first android app. I'm VERY new
I am very new to Android development. I am converting my iPhone app to
Im very new to this android development.I just started to create a hello world
I'm very new to Android development and can't find the answer to this. I
I am very new to Android development, so I appologise in advance if this
I'm very new to android development. I would like to make a android app

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.