有很多与我相关的重复,但大多数没有给出关于我的查询的答案:我想只做基于服务的应用程序甚至单个活动。我已阅读教程并从stackoverflow获取帮助。我以这种方式实施
我的问题:
它没有向我显示任何Toast nether Log
请帮我看看 我犯错误的地方
清单
<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));
}
};