To accept minus sign to enter negative number, change it to android:inputType="numberSigned".
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="com.example.androidstringformat.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:autoLink="web"
android:text="http://android-er.blogspot.com/"
android:textStyle="bold" />
<EditText
android:id="@+id/edit1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="numberSigned" />
<Button
android:id="@+id/buttonprint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=" - Print - " />
<TextView
android:id="@+id/printout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
3 comments:
Thanks for creating this informative post. I got solution of my problem from this post.
thanks man, and what about binary?
Great article. it is informative.
Post a Comment