On Sun, Sep 23, 2012 at 11:32 PM, vaish <[email protected]> wrote:

> hey evry1..
>>
> actually i 've tried onClick property on my textview but still it's not
> wrking.. even i've directly used onclicklistener also on my text view, like
> this-
>
> overWtLink=(TextView) findViewById(R.id.textView6);
> public void OverWt(View view)
> {
> if(view.getId()==R.id.textView6)
> {
> Intent i=new Intent();
> i.setClass(getApplicationContext(), overWtDiet.class);
> startActivity(i);
> }
> }
>
> can any1 pls let me know, is anythg wrong wid this code, or any
> alternative way to solve this query..
>


I would like to know, where have you placed the onClick method and
initializing your textview.

Try to initialize your textview in your onCreate, and give onClick method
outside onCreate.

You may also do the following in your onCreate:

*overWtLink=(TextView) findViewById(R.id.textView6);*
*overWtLink.**setOnClickListener(new OnClickListener() {
*
*
*
*                        @Override
*
* **public void onClick(View view)*
* **{*
* **if(view.getId()==R.id.textView6)*
* **{*
* **Intent i=new Intent();*
* **i.setClass(getApplicationContext(), overWtDiet.class);*
* **startActivity(i);*
* **}*
* **} *
*                      });*
*
*
*
*
Please mention, what error are you getting, as well, so that we can
understand what's wrong?*
*

Thanks n Regards
NSR

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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