Question

Has anyone ever successfully implemented an EditText in a widget? I realize Android does not support this, however, "Friend Stream" on HTC devices does it... Is this due to an HTC feature? Could I implement this on HTC? Anyone have any crazy creative ideas for implementing a textbox which actually allows typing on a homescreen widget?

ANY possible leads on this would be much appreciated!

Was it helpful?

Solution

Most of this can be google-ed, expept for the style of TextViews (you can not use EditText in widget..)

But.. go with the style property.. :)

<TextView
    android:id="@+id/etBlahblah"
    android:layout_width="0dp"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:layout_marginTop="4dp"
    android:layout_marginBottom="4dp"
    android:layout_marginLeft="2dp"
    android:layout_marginRight="2dp"
    style="@android:style/Widget.EditText">
</TextView>

OTHER TIPS

A way to do this is to make a tap on your widget start a new activity (standard) and to make this activity fully transparent. There are ways to retrieve your widget's position, so that you can position a TextView in your activity on top of your widget. Make a tap outside of your TextView close the activity. I think this is what the Google search widget does, you may want to look at this code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top