开发者

How to create a TextView as link that will open another activity in my application?

开发者 https://www.devze.com 2023-03-03 06:37 出处:网络
I want to create a TextView in my first Activity as a link, when i click on that textviewi want to start the second activity in my applic开发者_运维技巧ation.Implement a View.OnClickListener for your

I want to create a TextView in my first Activity as a link, when i click on that textview i want to start the second activity in my applic开发者_运维技巧ation.


Implement a View.OnClickListener for your TextView and start the other activity in the listener:

textView.setOnClickListener(new View.OnClickListener(){
       public void onClick(View v){
             Intent intent = new Intent(this, OtherActivity.class);
             startActivity(intent);
       }
});


i got some suitable solutions for my requirement in this Link , in this i created TextView with autolink = all, it is working fine for me.


Use textView.setOnClickListener() (View.OnClickListener) to start new activity, please refer to the documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消