diff --git a/res/layout/notification.xml b/res/layout/notification.xml new file mode 100644 index 0000000..4ec387c --- /dev/null +++ b/res/layout/notification.xml @@ -0,0 +1,12 @@ + + + + diff --git a/src/org/galexander/sshd/SimpleSSHDService.java b/src/org/galexander/sshd/SimpleSSHDService.java index e5e5328..5666194 100644 --- a/src/org/galexander/sshd/SimpleSSHDService.java +++ b/src/org/galexander/sshd/SimpleSSHDService.java @@ -6,6 +6,7 @@ import android.app.Service; import android.content.Intent; import android.content.Context; import android.os.IBinder; +import android.widget.RemoteViews; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; @@ -66,6 +67,10 @@ public class SimpleSSHDService extends Service { n.contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, SimpleSSHD.class), PendingIntent.FLAG_UPDATE_CURRENT); + + n.contentView = new RemoteViews(getPackageName(), + R.layout.notification); + startForeground(1, n); } }