File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes android - intent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "android - intent" Watch "android - intent" New topic
Author

android - intent

paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
hi everybody!!!

i have problem with Intent in Android...

in my project i have 2 Activity...the Main ACTYVITY and the second activity...

In second Activity i have one ListView and when i click to lis,t go to in MainActivity for show the result row...

but i have the problem in MainActivit when open for fist or when open the MainActivity without click on listView in second Activity;

This is the code of MainActivity:


The problems is when open the MainActivity...

how to do???

help me please!!!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
What is "the problem"? Remember that we don't have your app running, so we have no idea what's happening. What exactly is happening if you do what, and what would you like to have happen instead? (Yes, that's 3 questions :-)


Ping & DNS - my free Android networking tools app
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
i will read all cod:
this is MainActivity:


if you copy code you can understand my problem!!!

when i start the MayActivity show error!!! don't want this error!!!
help!!!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
I'm not going to run your code, that's way more effort than I'm willing to expend. Maybe someone else will step in, but if you're not willing to post a problem description, I doubt it.
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
the problem is in:



when I launch the program this code prevents operation of MainActivity...but this code is important when i click on ListView in second Activity for show row of listView in MainActivity...how i can to use this code without problem???

i hope you can understand my problem....
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
While you haven't told us what exactly happens, I'm guessing that "bookName" is null when the app first launches, and there's an exception because the code doesn't check for that. (Hint: the logcat output contains the full stack trace if there's a crashing exception - ready for copy/paste.)

Why don't you just put the code that should only execute if launched from Lista in an if-block that only executes if "bookName" has been passed in?
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
hi!! i have understand the problem!!!

i have edit my code:



with "if" i haven't problems!!! thank's
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: android - intent
 
Similar Threads
listview not clickable
getting null pointer
android custom list view position and click event problem(list getting dynamic data from server)
Creating one's first android app
Two Buttons - Only one works?