Skip to content

Tag: java

How to kill currently running task in android

I am trying to build a task killer type of app in android. I can show the list of currently running task using ActivityManager but facing problem in killing the task. Here is what i am doing to get the list of currently running task : It worked for me But now as I am trying to kill the task

Printing the enum’s name

I’m using eclipse + Android SDK on Ubuntu. I would like to print the name of a sensor type device, there a a lot of them and I want to do it automatically. If I use a I print the (int) type, but I would like the name of the enum. How could I do that? Answer For enumerations, you

Testing Private method using mockito

How to test private method is called or not, and how to test private method using mockito? Answer You can’t do that with Mockito but you can use Powermock to extend Mockito and mock private methods. Powermock supports Mockito. Here’s an example.