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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:50:23+00:00 2026-06-01T06:50:23+00:00

Im working on an app designed for android 3.0 onwards, and I want to

  • 0

Im working on an app designed for android 3.0 onwards, and I want to use one button to first setText in a text view and then change screen from screen1 to screen2…

Here is my code so far (causes a crash):

    Button mainNext = (Button) findViewById(R.id.Recipe1);
    mainNext.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {

            final TextView mTextView = (TextView) findViewById(R.id.textView3);
            mTextView.setText("Some Text");

            Intent i = new Intent();
            i.setClassName("com.bluStudios.Recipes4U.ics", "com.bluStudios.Recipes4U.ics.recipedisplayscreen");
            startActivity(i);
        }
    });

Any ideas???
Thanks in advance 😛

EDIT:

Code for 1st screen:

public class Recipe_Button_List extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.recipe_button_list);


    Button mainNext = (Button) findViewById(R.id.Recipe1);
    mainNext.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            final TextView mTextView = (TextView) findViewById(R.id.textView3);
            mTextView.setText("Some Text");
Intent i= new Intent(Recipe_Button_List.this, recipedisplayscreen.class); 
            startActivity(i);
        }
    });
}

}

Code for 2nd screen:

public class recipedisplayscreen extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.recipedisplayscreen);
    ActionBar actionBar = getActionBar();
    setTitle(R.string.title);
    actionBar.setDisplayHomeAsUpEnabled(true);}

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                // App icon in action bar clicked; go home
                Intent intent = new Intent(this, MainScreen.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

 @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.recipe_menu1, menu);
        return true;

}

}

  • 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-01T06:50:25+00:00Added an answer on June 1, 2026 at 6:50 am

    use this :

        Button mainNext = (Button) findViewById(R.id.Recipe1);
            mainNext.setOnClickListener(new OnClickListener() {
                public void onClick(View v) {
                    final TextView mTextView = (TextView) findViewById(R.id.textView3);
                    mTextView.setText("Some Text");
        Intent i= new Intent(YOUR_CURRENT_ACTIVTY_NAME.this, recipedisplayscreen.class); 
    ///or  you can use Intent i= new Intent(getBaseContext(),recipedisplayscreen.class); 
                    startActivity(i);
                }
            });
    

    and must recipedisplayscreen activity in AndroidManifest.xml

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

Sidebar

Related Questions

I'm working on an Android app that uses high-resolution GPS data. It's designed to
My app was working and I did not change a single thing in the
I'm working on an app that involves a lot of carefully designed strings. I'm
I'm working on a simple web app using jQuery mobile, and it is designed
I'm working on a simple, internal ASP.NET app for a small company. I've designed
I'm working on a Javascript-intensive web app designed to run on iPhone/iPad for now.
This is my first attempt to publish an app to Android Market and I've
Suppose the app you are working on is specially designed for a customer to
I am working on a client project for an android app and wanted to
I'm currently working on an app that is being created using Ironspeed Designer. It's

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.