There are many duplicate related to mine but mostly have not given answer regarding to my query: I want to make only service based App not even single activity.I have read tutorials and took help from stackoverflow. I have implement in this way
- Made BroadcastReciver
- Delcared BroadcastReciver in Manifest
- started service in BroadcastReciver
My problem:
- My broadcastReciver doesn't even start.and also no service started by it
It doesn't show me any Toast nether Log
Please help me figure out where i m making mistake
Manifest
<receiver android:name=".BroadcastReciverOnInstalltion" >
<intent-filter >
<action android:name="android.intent.action.PACKAGE_INSTALL" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_FIRST_LAUNCH" />
<data android:scheme="com.example.latest.sampleaudio" />
</intent-filter>
</receiver>
BroastcatReciver
public class BroadcastReciverOnInstalltion extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Log.i("installeded", "installeded");
Toast.makeText(context, "...", Toast.LENGTH_LONG).show();
context.startService(new Intent(context, ServiceMusic.class));
}
};