Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)anddev.org • View topic - start activity on USB connect

I will however give you a hint about looking into the activity life cycle. Specifically regarding exactly under what conditions OnCreate() is called and wether you need to put your check in the OnStart() method.

As for the second part of your question, take a look at ACTION_UMS_CONNECTED

but using a getIntent to check whether the USB is connected or not is carried out in the activity itself right?
But i wanted the activity to do no such thing. I want the broadcast receiver to listen to usb connect events. and whenever there is media unmounted, start an activity.

I understood the launcher should not be in the manifest. I removed that but now nothing happens at all. There is no icon in the programs page(as expected) but there is no action done when i insert the USB also.

And implement the USBReceiver by extending BroadcastReceiver.
You don't need to start anything in order to receive the broadcast as it will activate your receiver as long as it is installed on the phone.

Sorry, I didn't mean for you to take those lines out of your manifest, what you were meant to understand is that starting your debugger is the same as clicking on the icon, so of course the activity starts. The getIntent() has nothing to do with USB plugging, or anything like that. It has to do with determining HOW your activity was started, which was your original problem.