Skip to content
Snippets Groups Projects
Commit 9550007a authored by Massimiliano's avatar Massimiliano
Browse files

Fixed notification to close without clicking on it

parent 52425780
Branches
Tags
No related merge requests found
...@@ -5,6 +5,7 @@ import android.annotation.SuppressLint; ...@@ -5,6 +5,7 @@ import android.annotation.SuppressLint;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.DownloadManager; import android.app.DownloadManager;
import android.app.Notification;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.app.ProgressDialog; import android.app.ProgressDialog;
...@@ -1889,7 +1890,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL ...@@ -1889,7 +1890,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
checkDate.edit().putString( "storeDate", stateDate).apply(); checkDate.edit().putString( "storeDate", stateDate).apply();
//return null; //return null;
} }
else if (!stateDate.equals( dateStored )&& !stateDate.equals( "" )) else if (!stateDate.equals( dateStored )&& !stateDate.equals( "" ))//dateStored
{ {
checkDate.edit().putString( "storeDate", stateDate).apply(); checkDate.edit().putString( "storeDate", stateDate).apply();
Log.e(TAG, "date: " + dateStored); Log.e(TAG, "date: " + dateStored);
...@@ -1949,6 +1950,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL ...@@ -1949,6 +1950,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
NotificationCompat.Builder mBuilder = NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this) new NotificationCompat.Builder(this)
.setAutoCancel( true ) .setAutoCancel( true )
.setOngoing(true)
.setSmallIcon(R.drawable.ic_state) .setSmallIcon(R.drawable.ic_state)
.setContentTitle( getString( R.string.NotificationTitle ) ) .setContentTitle( getString( R.string.NotificationTitle ) )
.setContentText(name)//get text Title from json :-) .setContentText(name)//get text Title from json :-)
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<change>Spanish, Serbian and French translation updated</change> <change>Spanish, Serbian and French translation updated</change>
<change>Added pull to refresh page</change> <change>Added pull to refresh page</change>
<change>Fixed text layout under icons</change> <change>Fixed text layout under icons</change>
<change>Fixed notification to close without clicking on it</change>
</release> </release>
<release version="1.1.0" versioncode="13" > <release version="1.1.0" versioncode="13" >
<change>State page is api based instead of webview</change> <change>State page is api based instead of webview</change>
......
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