Skip to content

Commit

Permalink
Implement the fire receiver, clean up the prefs editor for the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
matburt committed Jan 30, 2012
1 parent 59a373a commit 63a733f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
5 changes: 4 additions & 1 deletion AndroidManifest.xml
Expand Up @@ -32,19 +32,22 @@
android:name="android.appwidget.provider"
android:resource="@xml/widget_mobileorg" />
</receiver>

<service android:name=".Services.MobileOrgWidget$MobileOrgWidgetService" >
<intent-filter>
<action android:name="com.matburt.mobileorg.Synchronizer.action.SYNC_UPDATE" />
</intent-filter>
</service>

<service android:name=".Services.SyncService" >
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />

<action android:name="com.matburt.mobileorg.SYNC_SERVICE" />
</intent-filter>
</service>
<receiver android:name="Plugin.SyncActivity" >

<receiver android:name="Plugin.Synchronize" >
<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING" />
</intent-filter>
Expand Down
13 changes: 1 addition & 12 deletions src/com/matburt/mobileorg/Plugin/SyncEditActivity.java
Expand Up @@ -33,18 +33,7 @@ public void finish()
}
else {
final Intent resultIntent = new Intent();
String message = r.getString(R.string.sync_plugin_message);
if (message.length() > getResources().getInteger(com.twofortyfouram.locale.platform.R.integer.twofortyfouram_locale_maximum_blurb_length))
{
resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_STRING_BLURB,
message.substring(0,
getResources().getInteger(com.twofortyfouram.locale.platform.R.integer.twofortyfouram_locale_maximum_blurb_length)));
}
else {
resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_STRING_BLURB, message);
}

setResult(RESULT_OK, resultIntent);
setResult(RESULT_OK, resultIntent);
}
super.finish();
}
Expand Down
16 changes: 16 additions & 0 deletions src/com/matburt/mobileorg/Plugin/Synchronize.java
@@ -0,0 +1,16 @@
package com.matburt.mobileorg.Plugin;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.matburt.mobileorg.Services.SyncService;

public final class Synchronize extends BroadcastReceiver
{
@Override
public void onReceive(final Context context, final Intent intent) {
context.startService(new Intent(context, SyncService.class));
}
}

0 comments on commit 63a733f

Please sign in to comment.