Advertisement
Guest User

Untitled

a guest
Jun 26th, 2015
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. //Activity target
  2. protected void onCreate(Bundle savedInstanceState) {
  3. super.onCreate(savedInstanceState);
  4. Intent intent = getIntent();
  5. if(intent != null && intent.getExtras() != null) {
  6. Bundle extras = intent.getExtras();
  7. if (extras.containsKey(ChallengeProposal.NAME))
  8. proposal = (ChallengeProposal) intent.getSerializableExtra(ChallengeProposal.NAME);
  9. }
  10. }
  11.  
  12. // Service calling notification
  13. public int onStartCommand(Intent intent, int flags, int startId) {
  14. Intent intentCancel = new Intent(getApplicationContext(), ChallengeProposalActivity.class);
  15. intent.setAction(String.valueOf(System.currentTimeMillis()));
  16. intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
  17. intent.putExtra(ChallengeProposal.NAME, proposal);
  18. PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intentCancel, 0);
  19. builderProgress.addAction(R.mipmap.ic_ab_close, "Cancelar", pendingIntent);
  20. // notify by NotificationManager
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement