Commit 2038b1c0 authored by Brian Samson's avatar Brian Samson

better notification icon, default icon

parent a940ddd8
......@@ -26,6 +26,7 @@
<source-file src="src/android/data/sqlite/LocationOpenHelper.java" target-dir="src/com/tenforwardconsulting/cordova/bgloc/data/sqlite" />
<source-file src="src/android/data/sqlite/SQLiteLocationDAO.java" target-dir="src/com/tenforwardconsulting/cordova/bgloc/data/sqlite" />
<source-file src="src/android/notification.png" target-dir="res/drawable" />
<source-file src="src/android/android-support-v4.jar" target-dir="libs" />
<config-file target="AndroidManifest.xml" parent="/manifest/application">
......
package com.tenforwardconsulting.cordova.bgloc;
import java.util.Arrays;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
......@@ -113,7 +115,14 @@ public class LocationUpdateService extends Service implements LocationListener {
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
Application application = this.getApplication();
int backgroundIconId = application.getResources().getIdentifier("background_notification", "drawable", application.getPackageName());
int backgroundIconId = 0;
for (String s: Arrays.asList("ic_launcher", "icon", "notification") ) {
backgroundIconId = application.getResources().getIdentifier(s, "drawable", application.getPackageName());
if (backgroundIconId != 0) {
break;
}
}
int appNameId = application.getResources().getIdentifier("app_name", "string", application.getPackageName());
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment