[Solved] Android programming broadcastreceiver


I think you are only missing a small piece:

String restoredText;
String restoredname;

public void addNotification(Context context) {
    getPref(context);
    String myString = restoredText + " " + restoredname;
    ...
    .setContentText(myString)
    ...
}

public void getPref(Context context) {
    restoredText = sp.getString("purpose", "");
    restoredname = sp.getString("name", "");
}

solved Android programming broadcastreceiver