Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Activity target
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- Intent intent = getIntent();
- if(intent != null && intent.getExtras() != null) {
- Bundle extras = intent.getExtras();
- if (extras.containsKey(ChallengeProposal.NAME))
- proposal = (ChallengeProposal) intent.getSerializableExtra(ChallengeProposal.NAME);
- }
- }
- // Service calling notification
- public int onStartCommand(Intent intent, int flags, int startId) {
- Intent intentCancel = new Intent(getApplicationContext(), ChallengeProposalActivity.class);
- intent.setAction(String.valueOf(System.currentTimeMillis()));
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
- intent.putExtra(ChallengeProposal.NAME, proposal);
- PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intentCancel, 0);
- builderProgress.addAction(R.mipmap.ic_ab_close, "Cancelar", pendingIntent);
- // notify by NotificationManager
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement