Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
This week's book giveaway is in the
Spring
forum.
We're giving away four copies of
Java Persistence with Spring Data and Hibernate
and have Cătălin Tudose on-line!
See
this thread
for details.
Win a copy of
Java Persistence with Spring Data and Hibernate
this week in the
Spring
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
Android
Create a new Intent error crash?
Slay Sk
Greenhorn
Posts: 2
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
I'm trying to create a new Intent and for some reason it crashes all the time - I'm going to post my code - please tell me what I'm doing wrong.
package com.projects.digi; import com.projects.createuser.CreateUser; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends Activity { public Button _btn; /* --------------------------------------------------- */ /* --------------------------------------------------- */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); _btn = (Button)findViewById(R.id.btnRegister); _btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { run(); } }); } public void run() { //Create an Intent object for this activity, including it's destination class Intent intent = new Intent(MainActivity.this, CreateUser.class); //Start the activity startActivity(intent); } /* --------------------------------------------------- */ /* --------------------------------------------------- */ @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_digitalcocoon, menu); return true; } }
Thanks
Ulf Dittmer
Rancher
Posts: 43075
77
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Post the exception stack trace from the logcat output.
Slay Sk
Greenhorn
Posts: 2
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Wait, is the problem maybe becouse I didn't add the new activity to the manifest?
Ulf Dittmer
Rancher
Posts: 43075
77
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Why wonder? Just look at the logcat and be sure. There's sure to be an exception in there if the app crashes.
It means our mission is in jeapordy! Quick, read this tiny ad!
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Why error in this code
Problem with creating a simple Menu in Browser view.
R cannot be resolved to a variable , syntax errors in program that was working fine day before
Problem with onCreateOptionsMenu
launch skype after click button in the app
More...