Android 톱 바에 알림을 보내려고합니다. 사용자가이를 클릭하면 downloadmanager에서 파일 다운로드를 시작합니다. 이 알림에 대해 pendingIntent를 설정하는 방법은 무엇입니까?android에서 알림을 클릭하면 다운로드를 시작합니다.
0
A
답변
0
Android Notifications - Tutorial 당신이 원하는 것을 달성하는 데 분명 도움이 될 것입니다.
아래에서 원하는 것을 발췌 한 것입니다. 다음 기능을 호출 할 수 있습니다.
public void createNotification(View view) {
// Prepare intent which is triggered if the
// notification is selected
Intent intent = new Intent(this, NotificationReceiverActivity.class);
PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);
// Build notification
// Actions are just fake
Notification noti = new Notification.Builder(this)
.setContentTitle("Title")
.setContentText("Subject").setSmallIcon(R.drawable.icon)
.setContentIntent(pIntent)
.addAction(R.drawable.icon, "Call", pIntent)
.addAction(R.drawable.icon, "And more", pIntent).build();
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
// Hide the notification after its selected
noti.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(0, noti);
}
다운로드 관리자를 시작하려면 그에 따라 기능을 조정해야 할 수 있습니다. 자세한 내용은 자습서 링크를 확인하십시오. 또한 도움이 될 수 있습니다 기타 관련 답변이 있습니다
Start downloading on Notification bar click in android
Android how to start an apk download from the notification drawer
open file on click of notification?
Opening activity after clicking push notification android 질문입니다.
희망이 도움이됩니다.
관련 문제
- 1. Android : 알림을 클릭하면 항상 최고의 활동을 시작합니다.
- 2. android httpclient가 서버에서 다운로드를 시작합니다.
- 3. Perl이 스크립트에서 다운로드를 다시 시작합니다.
- 4. XCode 5 다운로드를 다시 시작합니다.
- 5. 뉴스 스탠드에서 다운로드를 다시 시작합니다.
- 6. android에서 알림을 클릭하십시오.
- 7. 알림을 클릭하면 활동이 업데이트됩니다.
- 8. 웹 페이지가 자동으로 오디오 파일 다운로드를 시작합니다.
- 9. LiveConnectClient가 중단 된 다운로드를 다시 시작합니다.
- 10. Android에서 Salesforce 앱으로 시작합니다.
- 11. 클릭하면 캔버스에 이미지가 나타나기 시작합니다.
- 12. android에서 알림을 캡처
- 13. android에서 여러 다운로드를 시작하는 방법
- 14. 알림을 클릭하면 활동 다시 시작
- 15. 더 빨리 배포하고 Android에서 시작합니다.
- 16. Google 드라이브는 웹 사이트에서 공개 파일의 다운로드를 시작합니다.
- 17. Android에서 위젯을 클릭하면 작업 수행
- 18. android에서 알림을 삭제하는 방법
- 19. android에서 알림을 보내고 받음
- 20. Android에서 기존 알림을 읽으십시오.
- 21. 격자보기에서 다운로드를 클릭하면 파일을 열 수 없습니다.
- 22. 번쩍이기 알림을 클릭하면 앱이 실행됩니다.
- 23. 알림을 클릭하면 json 객체가 반환됩니다.
- 24. 알림을 클릭하면 Firebase onMessageReceived가 호출됩니다.
- 25. IBM Mobilefirst : 알림을 클릭하면 앱이 다시 시작됩니다.
- 26. 알림을 클릭하면 사용자 지정 대화 상자가 시작됩니다.
- 27. android에서 비동기 알림을 만드는 방법
- 28. Android에서 푸시 알림을 구현하는 방법
- 29. 터치하여 알림을 android에서 확장 하시겠습니까?
- 30. android에서 맞춤 알림을 만드는 방법