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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:25:58+00:00 2026-05-30T07:25:58+00:00

I have this code: package com.problemio; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View;

  • 0

I have this code:

package com.problemio;

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

public class ProblemioActivity extends Activity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Button addProblemButton = (Button)findViewById(R.id.add_problem_button);   
        Button browseProblemsButton = (Button)findViewById(R.id.browse_problems_button);   
        Button searchProblemsButton = (Button)findViewById(R.id.search_problems_button);   
        Button myProblemsButton = (Button)findViewById(R.id.my_problems_button);           

        addProblemButton.setOnClickListener(new Button.OnClickListener() 
        {  
            public void onClick(View v) {
              Intent myIntent = new Intent(ProblemioActivity.this, AddProblemActivity.class);
              ProblemioActivity.this.startActivity(myIntent);
            }
        });        
    }
}

It compiles fine and displays the addProblemButton button, but when that button is clicked, the system gives a runtime exception.

Here is the AddProblemActivity class:

package com.problemio;

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

public class AddProblemActivity extends Activity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //TextView text = (TextView) dialog.findViewById(R.id.addProblemText);
        //text.setText(R.string.addProblemText);        

        TextView tv = new TextView(this);
        tv.setText("Please Add a Problem");
        setContentView(tv);        
    }
}

and here is the layout main.xml

<?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"
    >
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="First, add the problem you want to solve!"
    />

<TextView
    android:id="@+id/add_problem_text"    
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Add a Problem You Want To See Solved"
    />    

    <Button
    android:id="@+id/add_problem_button"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Add a Problem"
    />

    <Button
    android:id="@+id/browse_problems_button"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Browse Problems"

    />
    <Button
    android:id="@+id/search_problems_button"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Search Problems"
    />

    <Button
    android:id="@+id/my_problems_button"        
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="View My Problems"
    />    
</LinearLayout>

any idea what might be going wrong? By the way, I can’t seem to locate the stack trace of the exception. Where should I look for that in Eclipse? All it currently shows me is AndroidRuntimeException – dalvik.system.NativeStart.main

Thanks!!

  • 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-30T07:26:00+00:00Added an answer on May 30, 2026 at 7:26 am

    The only problem I can think of is that your Activity “AddProblemActivity” is not register in the manifest.

    See the logs under LogCat…you will find it in Window >Show View >Android > LogCat

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

Sidebar

Related Questions

package com.parseador.prueba; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.EditText; public class main extends
I have this code: package com.problemio; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList;
We have some code kicking around that uses this old internal Sun package for
I followed Google's Map View tutorial from this link http://developer.android.com/resources/tutorials/views/hello-mapview.html I've done the first
I have a strange problem in my android app. I have an activity which
I have this code in jQuery, that I want to reimplement with the prototype
I have this code: chars = #some list try: indx = chars.index(chars) except ValueError:
I have this code that performs an ajax call and loads the results into
I have this code #include <iostream> using namespace std; int main(int argc,char **argv) {
I have this code: CCalcArchive::CCalcArchive() : m_calcMap() { } m_calcMap is defined as this:

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.