How to open web links of a textview with in my app itself

50 Views Asked by At

I'm using Linkify to make the web links clickable inside my textview. But the problem is when I click on those links, they are opening in default browser. But I want to open those links within my app like Gmail (when we open links of an email links will be opened with in Gmail app).

This is my code

public class MainActivity extends AppCompatActivity {
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      TextView textView = findViewById(R.id.result);
      textView.setText("http://example.com Testing Linkify for web links");
      Linkify.addLinks(textView, Linkify.WEB_URLS);
   }
}

Can any one help me...

0

There are 0 best solutions below