80,352
社区成员
发帖
与我相关
我的任务
分享
((TextView) layout.findViewById(R.id.title)).setText(title);
priceText = (EditText) layout.findViewById(R.id.price);
priceText.setText(strPrice);
/**
* 实现一弹出对话框,就弹出键盘,让用户删除之前的数据
*/
priceText.setFocusable(true);
priceText.setFocusableInTouchMode(true);
priceText.requestFocus();
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
InputMethodManager imm = (InputMethodManager) context
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
}
}, 200);
<EditText
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.07"
android:layout_marginRight="20dp"
android:selectAllOnFocus="true"
android:numeric="signed"
android:inputType="numberSigned"
android:minWidth="100dip" />