I have a multimedia application that starts playback when an intention is sent to a player’s action with the following additional intentions; "path to music" and enter "mime / audio format".
I collect the intent data in the player’s action to start playback, and I delete past additions from the intent to avoid repeating the same request after switching the screen or activity that is returned to the foreground.
This is how I handle the intent:
final String data = getIntent().getDataString(); final String type = getIntent().getType(); // start playback requestPlay( data, type ); // remove intents because they are needed only once per call! this.getIntent().setDataAndType(Uri.parse(""), ""); this.getIntent().removeExtra("data"); this.getIntent().removeExtra("type");
The problem that I am facing is that randomly and rarely, I will open the application, and when it resumes in the player’s activity, the intention will contain the previous additional data and start playing ... It annoys me and my users are good .. .
Does anyone have any idea what is the best way to clear intents data? For some reason, an ActivityManager can store this data ...?
Thanks!
-Jona
android
Jona
source share