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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:04:32+00:00 2026-06-16T16:04:32+00:00

I am trying to call an activity from my mainactivity, but it is crashing

  • 0

I am trying to call an activity from my mainactivity, but it is crashing an I cannot figure out why.

I call the activity from my mainactivity using a button as follows

btnStart.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {
            Intent i = new Intent(MainActivity.this, ShapeScreen.class);
            startActivity(i);   
    }
});

This then opens up an activity with code as follows, which should just bring up the layout shapesscreen.xml (which has no errors in it)

public class ShapeScreen extends Activity {
   @Override
   public void onCreate(Bundle savedInstanceState) {
    setContentView(R.layout.shapescreen);
   }
}

The second activity is defined in my manifest

<activity
    android:name=".MainActivity"
    android:label="Cubic Measurement" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
<activity
    android:name=".ShapeScreen"
    android:label="Cubic Measurement" >
    <intent-filter>
        <action android:name="kurt.steveboss.shapescreen" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

But when I click this button the app crashes and I get the following error in my LogCat

 01-02 15:03:37.550: I/InputReader(2100): Touch event's action is 0x1 (deviceType=0) [pCnt=1, pending(waiting finished signal)=0, s=]
 01-02 15:03:37.550: I/InputDispatcher(2100): Delivering touch to current input target: action: 0x1
 01-02 15:03:37.550: I/InputDispatcher(2100): Delivering touch to current input target: action: 0x1
 01-02 15:03:37.550: I/InputDispatcher(2100): Delivering touch to current input target: action: 0x1
 01-02 15:03:37.555: I/ActivityManager(2100): START {intent.toShortString} from pid 8045
 01-02 15:03:37.555: I/power(2100): *** acquire_dvfs_lock : lockType : 1  freq : 1000000 
 01-02 15:03:37.555: D/PowerManagerService(2100): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT  frequency : 1000000  uid : 1000  pid : 2100  tag : ActivityManager
 01-02 15:03:37.555: W/ActivityManager(2100): mDVFSLock.acquire()
 01-02 15:03:37.570: D/ActivityManager(2100): Trying to launch applicationName
 01-02 15:03:37.580: D/KeyguardViewMediator(2100): setHidden false
 01-02 15:03:37.650: D/dalvikvm(8045): GC_FOR_ALLOC freed 22K, 2% free 18560K/18887K, paused 10ms
 01-02 15:03:37.655: I/dalvikvm-heap(8045): Grow heap (frag case) to 21.095MB for 2903056-byte allocation
 01-02 15:03:37.680: D/dalvikvm(8045): GC_CONCURRENT freed 2K, 2% free 21393K/21767K, paused 1ms+1ms
 01-02 15:03:37.765: D/dalvikvm(8045): GC_FOR_ALLOC freed <1K, 2% free 21394K/21767K, paused 9ms
 01-02 15:03:37.770: I/dalvikvm-heap(8045): Grow heap (frag case) to 23.864MB for 2903056-byte allocation
 01-02 15:03:37.790: D/dalvikvm(8045): GC_CONCURRENT freed <1K, 2% free 24229K/24647K, paused 1ms+2ms
 01-02 15:03:37.875: D/dalvikvm(8045): GC_FOR_ALLOC freed <1K, 2% free 24231K/24647K, paused 10ms
 01-02 15:03:37.880: I/dalvikvm-heap(8045): Grow heap (frag case) to 26.634MB for 2903056-byte allocation
 01-02 15:03:37.900: D/dalvikvm(8045): GC_CONCURRENT freed <1K, 2% free 27066K/27527K, paused 2ms+2ms
 01-02 15:03:37.985: D/dalvikvm(8045): GC_FOR_ALLOC freed <1K, 2% free 27067K/27527K, paused 9ms
 01-02 15:03:37.995: I/dalvikvm-heap(8045): Grow heap (frag case) to 29.404MB for 2903056-byte allocation
 01-02 15:03:38.015: D/dalvikvm(8045): GC_CONCURRENT freed <1K, 2% free 29902K/30407K, paused 1ms+1ms
 01-02 15:03:38.095: D/dalvikvm(8045): GC_FOR_ALLOC freed <1K, 2% free 29904K/30407K, paused 9ms
 01-02 15:03:38.105: I/dalvikvm-heap(8045): Grow heap (frag case) to 32.174MB for 2903056-byte allocation
 01-02 15:03:38.125: D/dalvikvm(8045): GC_CONCURRENT freed <1K, 2% free 32739K/33287K, paused 1ms+1ms
 01-02 15:03:38.210: D/dalvikvm(8045): GC_FOR_ALLOC freed <1K, 2% free 32741K/33287K, paused 10ms
 01-02 15:03:38.220: I/dalvikvm-heap(8045): Grow heap (frag case) to 34.944MB for 2903056-byte allocation
 01-02 15:03:38.235: D/dalvikvm(8045): GC_CONCURRENT freed <1K, 2% free 35576K/36167K, paused 2ms+2ms
 01-02 15:03:38.315: D/dalvikvm(8045): GC_FOR_ALLOC freed <1K, 2% free 35578K/36167K, paused 9ms
 01-02 15:03:38.325: I/dalvikvm-heap(8045): Grow heap (frag case) to 37.714MB for 2903056-byte allocation
 01-02 15:03:38.340: D/dalvikvm(8045): GC_CONCURRENT freed <1K, 2% free 38413K/39047K, paused 2ms+2ms
 01-02 15:03:38.415: D/dalvikvm(8045): GC_FOR_ALLOC freed <1K, 2% free 38414K/39047K, paused 10ms
 01-02 15:03:38.430: I/dalvikvm-heap(8045): Grow heap (frag case) to 40.485MB for 2903056-byte allocation
 01-02 15:03:38.445: D/dalvikvm(8045): GC_CONCURRENT freed <1K, 2% free 41249K/41927K, paused 2ms+2ms
 01-02 15:03:38.555: I/power(2100): *** release_dvfs_lock : lockType : 1 
 01-02 15:03:38.555: D/PowerManagerService(2100): releaseDVFSLockLocked : all DVFS_MIN_LIMIT are released 
 01-02 15:03:38.555: W/ActivityManager(2100): mDVFSLock.release()
 01-02 15:03:38.975: W/PowerManagerService(2100): Timer 0x7->0x3|0x0
 01-02 15:03:38.975: I/PowerManagerService(2100): Ulight 0x7->0x3|0x0
 01-02 15:03:38.975: D/lights(2100): write_int /sys/class/sec/sec_touchkey/brightness = 2
 01-02 15:03:38.975: D/PowerManagerService(2100): setLightBrightness : mButtonLight : 0
 01-02 15:03:39.725: D/KeyguardViewMediator(2100): handleTimeout
  • 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-16T16:04:33+00:00Added an answer on June 16, 2026 at 4:04 pm

    use this

    @Override
                public void onClick(View v) {
                    Intent i = new Intent("YOUR_ACTIVITY_CLASS.this,ShapeScreen.class");
                    startActivity(i);   
                }
    

    Instead of

     @Override
            public void onClick(View v) {
                Intent i = new Intent("kurt.steveboss.shapescreen");
                startActivity(i);   
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am Trying to call an Activity from Default activity but when trigger the
I'm trying to call a method from another class with a simple button in
I am getting this exception while I am trying to call an activity from
Hello I am trying to call a method (fileReader) that is using openFileInput(filename) from
I am trying to call an Activity from another instance of the activity. The
I'm trying to call an activity from a Preference item Ideally I'd like to
I'm trying to call JDIC from my application, but I can't get it to
I'm trying to bind a service from an activity and get possibility to call
I am trying to figure out how to start an app from a URL,
I'm trying to start a Service from my Activity to look out for changes

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.