Android BroadcastReceiver not triggered - android

there are a lot of questions related to this topic. but I cannot get it to run on my Device 4.2.1 on the emulator 5.0 it is working fine.:
here the Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bootService"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<receiver
android:name=".MyBroadcastReceiver"
android:enabled="true"
android:label="MyBroadcastReceiver" >
<intent-filter android:priority="1001" >
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".PingService" >
</service>
<service android:name=".UpdateService" >
</service>
<receiver android:name=".OnBootReceiver" >
<intent-filter android:priority="1001" >
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>
I tried it with 2 receivers: none of them working.
Here one of the receivers that should write a logfile to SD, which is working fine from the Launcher Activity:
public class MyBroadcastReceiver extends BroadcastReceiver {
// Restart service every 30 seconds
private static final long REPEAT_TIME = 1000 * 10;
#Override
public void onReceive(Context context, Intent intent) {
Log.e("MyBroadcastReceiver", "BroadcastReceiver");
appendLog("MyBroadcastReceiver BroadcastReceiver \n");
AlarmManager service = (AlarmManager) context
.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(context, UpdateService.class);
PendingIntent pending = PendingIntent.getBroadcast(context, 0, i,
PendingIntent.FLAG_CANCEL_CURRENT);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.SECOND, 30);
service.setInexactRepeating(AlarmManager.RTC_WAKEUP,
cal.getTimeInMillis(), REPEAT_TIME, pending);
Log.wtf("MyBroadcastReceiver", "Alarm went off");
}
public static void appendLog(String text) {
File logFile = new File("sdcard/logfile.txt");
if (!logFile.exists()) {
try {
logFile.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
try {
// BufferedWriter for performance, true to set append to file flag
BufferedWriter buf = new BufferedWriter(new FileWriter(logFile,
true));
buf.append(text);
buf.newLine();
buf.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
I cannot see the error. Anyone does?
PS the app is started once, so this: http://commonsware.com/blog/2011/07/05/boot-completed-regression.html is covered.
thanks,

It took me long the key to the problem was in the manifest.xml
here the changes to got it run (only the receiver block):
<receiver
android:name="com.example.bootService.MyBroadcastReceiver"
android:exported="true"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<data
android:path="com.example.bootService"
android:scheme="package" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
important was the
<category android:name="android.intent.category.DEFAULT" />
tag

Related

Background service using alarm manager

I have followed below example code for implementing Periodic background service. Periodic task executes correctly If app on foreground on 1st time. If, I close application then Background service is not working.
https://github.com/codepath/android_guides/wiki/Starting-Background-Services#using-with-alarmmanager-for-periodic-tasks
1) BroadcastReceiver service for Bootcomplete
public class BootBroadcastReceiver extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
// Launch the specified service when this message is received
Intent startServiceIntent = new Intent(context, MyTestService.class);
context.startService(startServiceIntent);
}
}
2) BroadcastReceiver to start service
public class MyAlarmReceiver extends BroadcastReceiver {
public static final int REQUEST_CODE = 12345;
// Triggered by the Alarm periodically (starts the service to run task)
#Override
public void onReceive(Context context, Intent intent) {
Intent i = new Intent(context, MyTestService.class);
i.putExtra("foo", "bar");
context.startService(i);
Toast.makeText(context, "Welcome --------1", Toast.LENGTH_LONG).show();
}
}
3) IntenetService class: To execute my background task
public class MyTestService extends IntentService {
// Must create a default constructor
public MyTestService() {
// Used to name the worker thread, important only for debugging.
super("test-service");
}
#Override
public void onCreate() {
super.onCreate(); // if you override onCreate(), make sure to call super().
}
#Override
protected void onHandleIntent(Intent intent) {
}
}
4) Service is started from activity as
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
scheduleAlarm();
}
// Setup a recurring alarm every half hour
public void scheduleAlarm() {
// Construct an intent that will execute the AlarmReceiver
Intent intent = new Intent(getApplicationContext(), MyAlarmReceiver.class);
// Create a PendingIntent to be triggered when the alarm goes off
final PendingIntent pIntent = PendingIntent.getBroadcast(this, MyAlarmReceiver.REQUEST_CODE,
intent, PendingIntent.FLAG_UPDATE_CURRENT);
// Setup periodic alarm every 5 seconds
long firstMillis = System.currentTimeMillis(); // alarm is set right away
AlarmManager alarm = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
// First parameter is the type: ELAPSED_REALTIME, ELAPSED_REALTIME_WAKEUP, RTC_WAKEUP
// Interval can be INTERVAL_FIFTEEN_MINUTES, INTERVAL_HALF_HOUR, INTERVAL_HOUR, INTERVAL_DAY
alarm.setRepeating(AlarmManager.RTC_WAKEUP, firstMillis,
30000, pIntent);
}
}
5) Manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="test.org.help">
<permission
android:name="test.org.help.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="au.com.KPS.companion.ACCESS_DATA" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="test.org.help.permission.UA_DATA" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- This app has permission to register with GCM and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="test.org.help.permission.C2D_MESSAGE" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.flash"
android:required="false" />
<uses-feature android:name="android.hardware.screen.landscape" />
<application
android:name="test.org.help.KPSApp"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:logo="#drawable/ic_actionbar_logo"
android:theme="#style/AppTheme"
tools:replace="android:icon, android:logo">
<!-- Activities -->
<activity
android:name="test.org.help.ui.activity.SplashActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.activity.JanRainLoginActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.LinkListActivity"
android:screenOrientation="portrait" />
<activity
android:name="test.org.help.ui.activity.KPSFragmentActivity"
android:exported="true"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"></activity>
<activity
android:name="test.org.help.ui.activity.NotificationDialogActivity"
android:excludeFromRecents="true"
android:label=""
android:launchMode="singleInstance"
android:noHistory="true"
android:screenOrientation="portrait"
android:taskAffinity=""
android:theme="#style/AppTheme.Dialog.Notification"></activity>
<receiver
android:name="test.org.help.receivers.NotificationReceiver"
tools:ignore="ExportedReceiver">
<intent-filter>
<action android:name="test.org.help.util.ACTION_SHOW_AGENDA" />
<action android:name="test.org.help.util.ACTION_SNOOZE" />
<action android:name="test.org.help.util.ACTION_DISMISS" />
<action android:name="test.org.help.util.ACTION_SHOW_DIALOG" />
<data android:scheme="KPS" />
<data android:mimeType="text/plain" />
<data android:pathPattern="au\.org\.KPS\.util/.*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name="com.google.zxing.client.android.CaptureActivity"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.Light.NoTitleBar"
tools:replace="android:theme,android:screenOrientation"></activity>
<activity
android:name="test.org.help.ui.activity.AppTutorialActivity"
android:screenOrientation="portrait"
android:theme="#style/SplashTheme"></activity>
<activity
android:name="test.org.help.ui.activity.TermsAndConditionsActivity"
android:label="#string/title_terms_and_conditions"
android:screenOrientation="portrait"></activity>
<activity
android:name="test.org.help.ui.activity.WarningActivity"
android:label="#string/title_Warning"
android:screenOrientation="portrait"></activity>
<activity
android:name="test.org.help.ui.activity.DifferentUserWarningActivity"
android:label="#string/title_Warning"
android:screenOrientation="portrait"></activity>
<activity
android:name="test.org.help.ui.activity.AppWhatsNewActivity"
android:label="#string/title_Warning"
android:screenOrientation="portrait"></activity>
<activity
android:name=".ui.activity.UserUpgradeActivity"
android:label="#string/title_upgrade"
android:screenOrientation="portrait"></activity>
<activity
android:name="eu.janmuller.android.simplecropimage.CropImage"
android:label=""
android:screenOrientation="portrait"></activity>
<!-- Facebook -->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<!-- Services -->
<receiver android:name="com.mobileapptracker.Tracker">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service
android:name="test.org.help.service.DBUpdateService"
android:exported="false"
android:label="#string/app_name">
<intent-filter>
<action android:name="test.org.help.service.DBUpdateService"></action>
</intent-filter>
</service>
<receiver android:name="test.org.help.receivers.TimeChangeReceiver">
<intent-filter>
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
</intent-filter>
</receiver>
<activity
android:name="com.janrain.android.engage.ui.JRFragmentHostActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden" />
<activity
android:name="com.janrain.android.engage.ui.JRFragmentHostActivity$Fullscreen"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden" />
<!--Hockey app crash report-->
<meta-data
android:name="net.hockeyapp.android.appIdentifier"
android:value="#string/hockey_app_id" />
<receiver android:name="test.org.help.syncmanager.Network.NetworkAvailability">
<intent-filter>
<action android:name=".android.action.broadcast" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
</intent-filter>
</receiver>
<activity
android:name=".db.AndroidDatabaseManager"
android:theme="#style/Theme.AppCompat.Light" /><!-- ATTENTION: This was auto-generated to add Google Play services to your project for
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information. -->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<service
android:name=".syncmanager.auto.MyTestService"
android:exported="false" />
<receiver
android:name=".syncmanager.auto.MyAlarmReceiver"
android:process=":remote"></receiver>
<receiver android:name=".syncmanager.auto.BootBroadcastReceiver">
</receiver>
</application>
</manifest>
If, implement above as sample project as separate then, background service is executing fine always. But If try to integrate with my existing code then not working...
Edited: Found Solution
It got resolved by adding full path android:name service in AndroidManifest.xml
<service
android:name="test.org.help.syncmanager.auto.MyTestService"
android:exported="false" />

Broadcast can not receive package_removed event after registered staticly in Manifest

I know there are similar question in statckoverflow, but they just do NOT work for me.
Broadcast receiver(staticly registe via manifest.xml) can NOT receive package_remove event after installing on device (without running main activity)
But the receiver works if main activity is running.
To register broadcastreceiver staticly in AndroidManifest.xml as followings
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.broadcastreceivertesting"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.broadcastreceivertesting.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.example.broadcastreceivertesting.PackageBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
</application>
</manifest>
PackageBroadcastReceiver as a receiver are like following:
public class PackageBroadcastReceiver extends BroadcastReceiver
{
#Override
public void onReceive(Context context, Intent intent)
{
final String action = intent.getAction();
if (Intent.ACTION_PACKAGE_REMOVED.equals(action))
{
File file = new File("/storage/sdcard0/zzz/yyy");
if (file.exists())
{
file.delete();
}
boolean createDir = new File("/storage/sdcard0/zzz/").mkdirs();
Log.d("XXX", "XXXX createDir=" + createDir);
try
{
file.createNewFile();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}
Do I miss something ?
Try changing this...
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
to this...
<intent-filter>
<action android:value="android.intent.action.PACKAGE_REMOVED" />
<scheme android:value="package" />
For more information, see this link on receiving package broadcast intents...
https://groups.google.com/forum/#!topic/android-developers/aX5-fMbdPR8

AlarmManager Does not work when Activity in background

In my App, I'm using AlarmManager for transmitting keep-alive every day once a day.
I'm using the following code for starting athe AlaramManager
Calendar calendar = DateUtils
.getNextKeepAliveTime(keepAliveHours, keepAliveMinutes);
Intent intent = new Intent(this, AlarmReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(getApplicationContext(),
ALARM_REQUEST_CODE, intent, 0); // PendingIntent.FLAG_UPDATE_CURRENT);
// Get the AlarmManager service
Log.d(TAG, "cal: " + calendar.toString());
AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
long diff = calendar.getTimeInMillis() - System.currentTimeMillis();
if(diff < 0) diff = AlarmManager.INTERVAL_FIFTEEN_MINUTES;
am.setInexactRepeating(AlarmManager.RTC_WAKEUP, diff, AlarmManager.INTERVAL_DAY, sender);
When activity goes background, the receiver, AlarmReceiver, does not get any event. But it working successfully when activity in foreground.
Ther receiver declaration in my manifest is -
<receiver android:name="MainActivity$AlarmReceiver" android:enabled="true" />
The manifest is
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.yachtdroid.ba.MainActivity"
android:label="#string/app_name"
android:launchMode="singleInstance" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.yachtdroid.ba.ui.Settings" >
</activity>
<receiver android:name="MainActivity$ChargingOnReceiver" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
</intent-filter>
</receiver>
<service android:name="com.yachtdroid.ba.services.MailSenderService" />
<service android:name="com.yachtdroid.ba.services.SmsSender" />
<activity android:name="com.yachtdroid.ba.ui.YDSiteView" />
<activity
android:name="com.yachtdroid.ba.ui.BatteryAlertDialog"
android:theme="#style/NoTitleDialog" />
<activity
android:name="com.yachtdroid.ba.ui.ActivityLog"
android:theme="#style/NoTitleDialog" />
<receiver android:name="MainActivity$AlarmReceiver" android:enabled="true" />
<!-- intent-filter>
<action android:name="alarm_action"/>
</intent-filter>
</receiver -->
</application>
The receiver code is
public static class AlarmReceiver extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, intent.getExtras().toString());
if (!inForeground) {
Log.d(TAG, "*** Move app to front!");
Intent it = new Intent("intent.my.action");
it.setComponent(new ComponentName(context.getPackageName(),
MainActivity.class.getName()));
it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.getApplicationContext().startActivity(it);
}
try {
Toast.makeText(context, "alarm message", Toast.LENGTH_SHORT).show();
MainActivity.instance.sendKeepALive();
} catch (Exception e) {
Toast.makeText(
context,
"There was an error somewhere, but we still received an alarm",
Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
}
}
How it can be solved?
Thanks,
Eyal.
Try to remove the code for the broadcast receiver from the Activity ,make another java file and put it there and also modify your manifest as per that
<receiver android:name=".AlarmReceiver" />
instead of
<receiver android:name="MainActivity$AlarmReceiver" android:enabled="true" />

Android: Why I am not receiving the BOOT_COMPLETED intent?

I am testing on an physical device (SAMSUNG ACE GT S5830i)
But I am not receiving the BOOT_COMPLETED intent therefore the service is not Receiver is not starting
This is the code I am using.
public class BootCompleteReceiver extends BroadcastReceiver {
static final String TAG = "InfoService.BroadcastReceiver";
#Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
Log.e(TAG, "System boot notification received.");
Intent service = new Intent(context, InfoService.class);
context.startService(service);
} else {
Log.e(TAG, "Intent received: " + intent);
}
}
}
This is the Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.appengine.paranoid_android.lost"
android:versionCode="2"
android:versionName="1.1">
<application android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<activity android:name=".InfoSetup"
android:label="#string/activity_name"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LockScreen"
android:label="#string/activity_name"
android:launchMode="singleInstance"
android:clearTaskOnLaunch="true"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<service android:name=".InfoService"
android:label="#string/service_name"/>
<receiver android:name=".BootCompleteReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<action android:name="android.intent.action.PACKAGE_CHANGED"/>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<!-- <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> -->
Try to add the full path with the package for <receiver android:name=".BootCompleteReceiver">
<receiver android:name="com.appengine.paranoid_android.lost.BootCompleteReceiver">

Not allowed to start service Intent

I'm trying to call a service from a activity:
When I'm running the program the activity throws an error which says: Not allowed to start service Intent. What am I doing wrong? I'm sorry for possible stupid mistakes in the code, but I'm a newbie.
activity code:
public void startService() {
try {
startService (new Intent ( this , SmsReminderService.class)) ; }
catch (Exception e ) { Log.v("Error" , e.getMessage()) }
}
service code :
public class SmsReminderService extends Service {
#Override
public void onStart(Intent intent, int startid) {
Log.v("SSms", "Service started") ; }}
manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.sms.smsReminder"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<permission android:name="SEND_SMS"></permission>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:label="#string/app_name"
android:name=".SmsReminderActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".SmsReminderService"
android:permission="android.permission.BIND_REMOTEVIEWS">
<intent-filter>
<action android:name = "android.intent.category.LAUNCHER" ></action>
</intent-filter>
</service>
</application>
</manifest>
Thanks in advance, Tom
Why this in the service?
<intent-filter>
<action android:name = "android.intent.category.LAUNCHER" ></action>
</intent-filter>
Try to add this:
<uses-permission android:name="android.permission.BIND_REMOTEVIEWS" />

Categories

Resources