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.
精彩评论