Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-09-25 19:39:58 +02:00
commit 014de1ad8b

View file

@ -4,17 +4,15 @@ import net.osmand.plus.OsmandPlugin;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.widget.Toast;
public class MediaRemoteControlReceiver extends BroadcastReceiver { public class MediaRemoteControlReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Intent sent", Toast.LENGTH_LONG).show();
if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) { if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) {
AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class);
if(plugin != null && intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) != null) { if(plugin != null && intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) != null) {
System.out.println("OsmAnd AV Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0)); // System.out.println("OsmAnd AV Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0));
// Toast.makeText(context, "Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0), Toast.LENGTH_LONG).show(); // Toast.makeText(context, "Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0), Toast.LENGTH_LONG).show();
} }
} }