EditText Alternatives in a Widget? There has to be a way

后端 未结 2 1283
挽巷
挽巷 2020-12-17 15:59

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 t

相关标签:
2条回答
  • 2020-12-17 16:38

    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>
    
    0 讨论(0)
  • 2020-12-17 16:53

    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.

    0 讨论(0)
提交回复
热议问题