Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 application.

like image 408
sathish Avatar asked May 05 '11 12:05

sathish


1 Answers

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);
       }
});
like image 95
codinguser Avatar answered Sep 28 '22 15:09

codinguser