The log output you just sent gives you the answer. At line 24 of your
helloone activity, in the onCreate() method, you are trying to
dereference a null pointer. Apparently, you did not retrieve the
button correctly.

On Thu, Nov 27, 2008 at 9:50 PM, suchita bhardwaj
<[EMAIL PROTECTED]> wrote:
> hey all,
>
> Here is output of Logcat.
> i am still not able to trace out where exjactly problem is...
> If i comment out button.setOnClickListener(),it displays button but i need
> to perform some event on clicking button.
> Does anyone having same issue??
>
> 11-28 11:16:17.568: ERROR/AndroidRuntime(289): Uncaught handler: thread main
> exiting due to uncaught exception
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289): java.lang.RuntimeException:
> Unable to start activity ComponentInfo{com.helloone/com.helloone.helloone}:
> java.lang.NullPointerException
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2156)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.os.Handler.dispatchMessage(Handler.java:88)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.os.Looper.loop(Looper.java:123)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.app.ActivityThread.main(ActivityThread.java:3742)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> java.lang.reflect.Method.invoke(Method.java:515)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> dalvik.system.NativeStart.main(Native Method)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289): Caused by:
> java.lang.NullPointerException
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> com.helloone.helloone.onCreate(helloone.java:24)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1122)
> 11-28 11:16:17.608: ERROR/AndroidRuntime(289):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2103)
>
>
> On Thu, Nov 20, 2008 at 6:20 PM, for android <[EMAIL PROTECTED]> wrote:
>>
>> In the next activity u may be doing somthing thats throwing the xception.
>>
>> Go to Eclipse -Window->ShowView->LogCat..and see the log trace there.
>>
>> On Thu, Nov 20, 2008 at 6:10 PM, suchita bhardwaj
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> Hey all,
>>>           when i start application with buttonlistener enabled and any
>>> line of code written in onClick(View v),,it shows message"Application needs
>>> to closed forcefully."
>>>
>>> On Thu, Nov 20, 2008 at 12:24 PM, 心蓝 <[EMAIL PROTECTED]> wrote:
>>>>
>>>> Usually  i do like this:
>>>>  Intent i = new Intent();
>>>>              i.setClassName(getApplicationContext(), Other.class);
>>>>              startActivity(i);
>>>>              finish();
>>>> 2008/11/20 suchita bhardwaj <[EMAIL PROTECTED]>
>>>>>
>>>>> Hii,
>>>>>        I am just trying to switch to next activity.Infact,anything
>>>>> written in onClick() is giving error on call to setOnClickListener.
>>>>> Here is code:
>>>>>               button.setOnClickListener(new View.OnClickListener() {
>>>>>                     public void onClick(View v) {
>>>>>
>>>>>                                                 Intent intent = new
>>>>> Intent(Login.this, ForgetPassword.class);
>>>>>                                                startActivity(intent);
>>>>>                     }
>>>>>                 });
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Nov 20, 2008 at 2:59 AM, Sunit Katkar <[EMAIL PROTECTED]>
>>>>> wrote:
>>>>>>
>>>>>> Can you post more code. The code you posted is standard event listener
>>>>>> code for a button in android.
>>>>>> - Sunit
>>>>>>
>>>>>> On Wed, Nov 19, 2008 at 2:37 AM, suchita bhardwaj
>>>>>> <[EMAIL PROTECTED]> wrote:
>>>>>>>
>>>>>>> Hi all,In my code
>>>>>>>  button.setOnClickListener(new View.OnClickListener() {
>>>>>>>                     public void onClick(View v) {
>>>>>>>
>>>>>>>                                                 // Perform any action
>>>>>>> on click
>>>>>>>                     }
>>>>>>>                 });
>>>>>>> I am not able to use listener in sdk1.0.Its giving error at run
>>>>>>> time.Please tell reason.Is there any change in method for implementing
>>>>>>> listener.Please reply asap.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> - Sunit Katkar
>>>>>> http://sunitkatkar.blogspot.com/ - Android OS Tutorials
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Welcome to my site about GPhone:
>>>>> http://51gphone.cn
>>>>> I am a GFans!!欢迎你来到我的GPhone网站!!http://51gphone.cn
>>>>>
>>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to