Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * Copyright (C) 2014 Fastboot Mobile, LLC.
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, see <http://www.gnu.org/licenses>.
 */

import android.content.Context;
import android.content.Intent;

public class Main {
    private static final String AVRCP_META_CHANGED = "com.android.music.metachanged";
    private static final String KEY_ID = "id";
    private static final String KEY_ARTIST = "artist";
    private static final String KEY_ALBUM = "album";
    private static final String KEY_TRACK = "track";
    private static final String KEY_LIST_SIZE = "ListSize";
    private static final String KEY_DURATION = "duration";
    private static final String KEY_POSITION = "position";

    public static void notifyMetaChanged(Context ctx, long id, String artist, String album, String track,
            int listSize, long duration, long position) {
        Intent i = new Intent(AVRCP_META_CHANGED);
        i.putExtra(KEY_ID, id);
        i.putExtra(KEY_ARTIST, artist);
        i.putExtra(KEY_ALBUM, album);
        i.putExtra(KEY_TRACK, track);
        i.putExtra(KEY_LIST_SIZE, listSize);
        i.putExtra(KEY_DURATION, duration);
        i.putExtra(KEY_POSITION, position);

        ctx.sendBroadcast(i);
    }
}