Hi,

First you will want to make the TextView clickable and focusable.
(android:clickable="true", android:focusable="true")

If you want the TextView to link to an address, phone number, website,
or email address you can use the AutoLink feature. (eg.
android:autoLink="web"; or android:autoLink="all")

I am not aware of the xml file that the browser uses for links. But
you can recreate this yourself. If you are looking to set custom click
listeners it will involve creating images for each of the states and
referencing them in a resource xml file. You then set this xml file as
the background of the TextView.

For example, this is the background of a standard EditText View
(platforms/android-1.5/data/res/drawable/edit_text.xml):

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing,
software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
     See the License for the specific language governing permissions
and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android";>
    <item android:state_window_focused="false"
android:state_enabled="true"
        android:drawable="@drawable/textfield_default" />
    <item android:state_window_focused="false"
android:state_enabled="false"
        android:drawable="@drawable/textfield_disabled" />
    <item android:state_pressed="true" android:drawable="@drawable/
textfield_pressed" />
    <item android:state_enabled="true" android:state_focused="true"
android:drawable="@drawable/textfield_selected" />
    <item android:state_enabled="true" android:drawable="@drawable/
textfield_default" />
    <item android:state_focused="true" android:drawable="@drawable/
textfield_disabled_selected" />
    <item android:drawable="@drawable/textfield_disabled" />
</selector>

If you are going to use a custom background I would suggest using this
as a template and use the Draw 9-patch tool to assign stretchable
regions to your drawables. (http://developer.android.com/guide/
developing/tools/draw9patch.html)

Hope this helps,

Paul

On Sep 9, 6:59 am, Falcon24 <falco...@yopmail.com> wrote:
> Hello,
> I'm currently beginning in java for android and I'm asking your help.
> I would like make some link in my program like phone number, mail
> etc.. with this border when the user clic on it.
> Well, when I create a WebView, the clicable link appears like that 
> :http://www.fro2.eu/Ayabame/border_android.bmp
> My questions are:
> What's the method who provide this border and can I use it with
> TextView and linkify ?
> Can we control it in xml file or just in .java file ?
>
> Thank in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to