Archive for November, 2010

How to exit from your app, or kill it

November 29th, 2010

Get an Activity Manager, and then ask for a package restart:

ActivityManager m_activityManager = (ActivityManager) getSystemService(Activity.ACTIVITY_SERVICE);
m_activityManager.restartPackage(PACKAGE_NAME);

And that’s it, it just works.

I know its not recommended, and that it’s against activities lifecycle, but sometimes it is necessary for your app.

Have fun!

Spam Problems

November 4th, 2010

Some spambots are messing around this blog (and I suppose that everyone’s else), so I’ve set comment moderation, just in case spam comes around.

Common comments are welcome!!!

Have fun!

Prevent Soft Keyboard from showing when EditText focused

November 2nd, 2010

If you have a custom EditText, that uses a different input method from soft keyboard, you should add this line to prevent him from showing.

m_edittext.setInputType(InputType.TYPE_NULL);

Really easy, huh?

Have fun!

Sharing Buttons by Linksku