开发者

Make a TextView Editable in a Launcher Widget (Android)

开发者 https://www.devze.com 2023-02-13 06:33 出处:网络
I\'m trying to create a launcher widget with a TextView that is editable. Everything I read says that android:editable is deprecated, so I haven\'t played with that much (even though it didn\'t look l

I'm trying to create a launcher widget with a TextView that is editable. Everything I read says that android:editable is deprecated, so I haven't played with that much (even though it didn't look like that worked anyway).

This is what the xml for the TextView looks like:

<TextView android:id="@+id/hours_textview"
          android:text="@string/zero"
          android:layout_gravity="center_horizontal|center"
          android:layout_marginTop="5dip"
          android:padding="10dip"
          android:textColor="@android:color/black" 
                      android:layout_width="5开发者_JAVA百科0dip" 
                      android:layout_height="fill_parent" 
                      android:inputType="number" 
                      android:typeface="serif" 
                      android:clickable="true" 
                      android:cursorVisible="true" 
                      android:digits="0123456789" 
                      android:focusable="true" 
                      android:selectAllOnFocus="true"/>

I'm pretty new to android developement so I'm probably missing something obvious. I'm not running any code to process the widget at this point. Do I need to set any event handlers to capture a tap and trigger the editing process? If so ... which events?


Editable text fields are not supported in Launcher app widgets.

0

精彩评论

暂无评论...
验证码 换一张
取 消