In my current android app I have a lot of input fields (EditText) and I need to disable the soft keyboard on focus, because I use my own kind of input widget.
I've try several solutions, but on some was the cursor not visible or the soft keyboard was blinking on focus for some ms. But this one works:
public static void disableSoftKeyboard(final EditText v) {
if (Build.VERSION.SDK_INT >= 11) {
v.setRawInputType(InputType.TYPE_CLASS_TEXT);
v.setTextIsSelectable(true);
} else {
v.setRawInputType(InputType.TYPE_NULL);
v.setFocusable(true);
}
}
Android, Java, PHP, Linux, Databases and other funny things.
I'm doing, I'm learning, I post it here.
Monday, March 10, 2014
Thursday, February 13, 2014
Disable FTP Server (proftpd) in Plesk
I don't need proftpd on my root server, I use sftp, so:
vi /etc/xinetd.d/ftp_psa
change
disable = no
vi /etc/xinetd.d/ftp_psa
change
disable = no
to
disable = yes
Thursday, November 28, 2013
Monday, March 25, 2013
Delete empty mails from maildrop
I don't know why I have a bunch of empty mails on maildrop folder of postfix, but ...
find /var/spool/postfix/maildrop/ -size 0 -name '*' -exec rm {} +
find /var/spool/postfix/maildrop/ -size 0 -name '*' -exec rm {} +
Postfix. Delete some mails from the queue
Change "123@example" to something you need ...
Wednesday, October 17, 2012
PHP session timeout cookie lifetime
There are many ways to set cookie based session timeout in PHP. You can edit your php.ini or put it in .htaccess but I choose for today this piece of code:
<?php
ini_set('session.gc_maxlifetime', 172800);
ini_set('session.cookie_lifetime', 172800);
session_start();
?>
The session above will be valid for 2 days.
Friday, October 12, 2012
Don't track me - Google Analytics
I have many websites and I don't want to be tracked by my own Google Analytics code.
This Add-On for Google Chrome should deactivate Google Analytics at all
This Add-On for Google Chrome should deactivate Google Analytics at all
Subscribe to:
Posts (Atom)