I have this View:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:weightSum="1"
android:orientation="vertical">
    <LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content">
        <include layout="@layout/buttontest"
android:layout_width="90dp" android:layout_margin="10dp"
android:layout_height="92dp" android:id="@+id/butt1"></include>
        <include layout="@layout/buttontest"
android:layout_width="93dp" android:layout_marginLeft="10dp"
android:layout_height="96dp" android:layout_marginTop="10dp"
android:id="@+id/butt2"></include>
    </LinearLayout>
    <LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content">
        <include layout="@layout/buttontest"
android:layout_width="90dp" android:layout_margin="10dp"
android:layout_height="92dp" android:id="@+id/butt3"></include>
        <include layout="@layout/buttontest"
android:layout_width="93dp" android:layout_marginLeft="10dp"
android:layout_height="96dp" android:layout_marginTop="10dp"
android:id="@+id/butt4"></include>
    </LinearLayout>
    <!-- <Button android:text="Button" android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>  -->
</LinearLayout>

The layout buttontest is very simple actually.

<?xml version="1.0" encoding="utf-8"?>
<com.test.buttontest android:background="@drawable/provafocus"
android:clickable="true" android:layout_width="212.0dip"
android:layout_height="70.0dip" android:layout_marginRight="14.0dip"
android:focusable="true" android:focusableInTouchMode="true"
  xmlns:android="http://schemas.android.com/apk/res/android";>
</com.test.buttontest>

As the class is simple.

public class buttontest extends FrameLayout {

        public buttontest(Context c)
        {
                super(c);
        }
        public buttontest(Context c,AttributeSet a)
        {
                super(c,a);
        }

}

This application run on device (Car Stereo) with Android 1.5 without
touch. So I need use the focus for choose which activity to run.
My device has only DPAD_UP, DPAD_DOWN, DPAD_CENTER, MEDIA_NEXT,
MEDIA_PREVIOUS.
Include layout I see not support attribute nextFocusDown, nextFocusUp
etc...
Is there a way for change focus Left and Right?

I would like to do it with changes to XML. Is it possible set
attribute nextFocusDown and nextFocusUp to include objects?
Can I remap the keys MEDIA_NEXT and MEDIA_PREVIOUS to DPAD_LEFT and
DPAD_RIGHT only for my application without change the file /system/usr/
keylayout/qwerty.kl ?
I see injectKeyEvent in IWindowManager (some site write an example
with it) but this class not exist.

Thank you for your suggestions.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to