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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:01:37+00:00 2026-06-10T07:01:37+00:00

I have main activity which contains few radio buttons. Their is one button named

  • 0

I have main activity which contains few radio buttons. Their is one button named config.
What I want to do is on clicking config new activity will start and selected radio button text will be displayed.
But when I click on config application is forced closing.I am not able to figure out the bug.
I have gone through following links to learn about intent
1) http://www.androidaspect.com/2012/07/passing-data-using-intent-object.html
2) http://www.androidaspect.com/2012/02/how-to-start-new-activity-using-intent.html
Here is the code for onclick from main activity:

configbtn.setOnClickListener(new Button.OnClickListener(){
        @Override
        public void onClick(View arg0) {            
            //Toast.makeText(getApplicationContext(), "You have clicked on 'Config'...", Toast.LENGTH_LONG).show();
            if(!mode.equals(""))
            {
            Intent i = new Intent("com.av.android.profiles.configActivity");
            Bundle myBundle = new Bundle();
            myBundle.putString("promode",mode);
            i.putExtras(myBundle);
            startActivityForResult(i, 1);
            }
             else
             {
                Toast.makeText(getApplicationContext(), "Please select profile mode to config...!", Toast.LENGTH_LONG).show();
             }

         }});

Code for Second Activity :

public class configActivity extends Activity{


Bundle myBundle1 = new Bundle();
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.config);
    String myName = null;       
    Bundle extras = getIntent().getExtras();
    if(extras != null)
    {
        myName = extras.getString("promode");
    }


    TextView tvData = (TextView) findViewById(R.id.tvData);
    tvData.setText(myName);
    }}

Thanks in advance

  • 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-10T07:01:39+00:00Added an answer on June 10, 2026 at 7:01 am

    Try

    Intent i = new Intent(CurrentActvity.this,configActivity.class);
    Bundle myBundle = new Bundle();
    myBundle.putString("promode",mode);
    i.putExtras(myBundle);
    startActivityForResult(i, 1);
    

    Declare configActivity in manifest file.

    <activity
                android:name=".configActivity" />
    

    and use myName = extras.getString("promode");

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

Sidebar

Related Questions

I am using fragments to show images/pages.I have one Activity(Main) which contains all the
i have main activity in which i have Four menus. and i have one
In my main activity I have a spinner which contains three categories(All,Horizontal and Vertical),
My situation is following. I have one Activity that contains three main parts. At
I have an application that contains a main Activity, which has a very simple
Hi I have an application which after login, loads a main activity which contains
I have some main activity and clicking on a button it launches a custom
I am making an app in which i have a main activity that the
I have a Tabhost which is my main activity. When a tab is clicked
If I have a login screen and then the activity which displays the main

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.