FileDocCategorySizeDatePackage
LinkifyTest.javaAPI DocAndroid 5.1 API1998Thu Mar 12 22:22:12 GMT 2015android.text.util

LinkifyTest

public class LinkifyTest extends android.test.AndroidTestCase
LinkifyTest tests {@link Linkify}.

Fields Summary
Constructors Summary
Methods Summary
public voidtestNormal()

        TextView tv;

        tv = new TextView(getContext());
        tv.setAutoLinkMask(Linkify.ALL);
        tv.setText("Hey, foo@google.com, call 415-555-1212.");

        assertTrue(tv.getMovementMethod() instanceof LinkMovementMethod);
        assertTrue(tv.getUrls().length == 2);
    
public voidtestNothing()

        TextView tv;

        tv = new TextView(getContext());
        tv.setText("Hey, foo@google.com, call 415-555-1212.");

        assertFalse(tv.getMovementMethod() instanceof LinkMovementMethod);
        assertTrue(tv.getUrls().length == 0);
    
public voidtestUnclickable()

        TextView tv;

        tv = new TextView(getContext());
        tv.setAutoLinkMask(Linkify.ALL);
        tv.setLinksClickable(false);
        tv.setText("Hey, foo@google.com, call 415-555-1212.");

        assertFalse(tv.getMovementMethod() instanceof LinkMovementMethod);
        assertTrue(tv.getUrls().length == 2);