0

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

  1. Made BroadcastReciver
  2. Delcared BroadcastReciver in Manifest
  3. started service in BroadcastReciver

My problem:

  1. My broadcastReciver doesn't even start.and also no service started by it
  2. It doesn't show me any Toast nether Log

  3. 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));


    }
};
Passion
  • 662
  • 1
  • 11
  • 29

0 Answers0