Ravishankar V
Ravishankar V

Reputation: 323

Navigating Textviews using arrow keys

My application has a simple 'About' box.

It has a few clickable TextViews (email addresses, phone nos, addresses) all contained within a relative layout within a ScrollView (To accommodate low res screens).

The device I am testing with (Motorola Charm O.S ver 2.1 update 1) has a regular QWERTY keyboard. The problem I am facing is with the use of the arrow keys.

I want the cursor to move predictably from one clickable field to the next and this is where I need help. On the fields that don't need focus I have set the android:cursorVisible="false".I tried using the android:nextFocus* properties but still don't get the desired behavior.

The cursor gets stuck in the first field and overall the behavior is a bit unpredictable. Any ideas on how to get this done. Right now trapping the keys using code seems to be the only option.

Upvotes: 0

Views: 975

Answers (1)

Greg Giacovelli
Greg Giacovelli

Reputation: 10184

TextView.setMovementMethod(LinkMovementMethod.getInstance())

The documentation is a little terse but it's basically what you are looking for.

Upvotes: 1

Related Questions