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 >> >> >> >> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---