File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

button to new activity

 
Amir Rahav
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have my main activity, wich has fe buttons, one of them - COLOR, will open a new list view activity with a list of colors.
so i have both of the xml, and both of the java pages. i put in the main acticity a listener for that button and made a new intent and gave the start activity command. but when i run it on the emulator it crashes when ipress COLOR button.

this is in my main activity:


what am i doing wrong?
 
Amir Rahav
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and that is the second activity - the color selec page:


 
Campbell Ritchie
Sheriff
Pie
Posts: 47278
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please indent your code correctly, and don’t double‑space it. I shall try to edit your code and you can see how much better it looks.
We can only help you if you give us more details. When does your application crash? Do you get a stack trace or error message? What does it say? Copy the exact text.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47278
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is .show() really supposed to be on a line by itself? Is it the Component#show() method? You realise that has been deprecated?
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's Android code, not Swing. Moving the thread.
 
Nick Johnson
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please elaborate more, so that we can understand the problem easily.......
 
Naishadh Parmar
Ranch Hand
Posts: 95
C++ Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you written about the second activity in the manifest file.
Many people don't write in the manifest file, and when the activity does not start they scratch their head.

You have to write under the <application> tag
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic