Search in sources :

Example 1 with CommonRequest

use of com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest in project NiceMusic by lizixian18.

the class NiceMusicApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    sContext = this;
    SpUtil.getInstance().init(this);
    CrashHandler.getInstance().init(this);
    // 直播链接在喜马拉雅获取,需要集成他们的sdk
    CommonRequest mXimalaya = CommonRequest.getInstanse();
    String mAppSecret = "8646d66d6abe2efd14f2891f9fd1c8af";
    mXimalaya.setAppkey("9f9ef8f10bebeaa83e71e62f935bede8");
    mXimalaya.setPackid("com.app.test.android");
    mXimalaya.init(this, mAppSecret);
    if (!BaseUtil.getCurProcessName(this).contains(":musicLibrary")) {
        NotificationCreater creater = new NotificationCreater.Builder().setTargetClass("com.lzx.nicemusic.module.main.HomeActivity").setFavoriteIntent(getPendingIntent(favoriteActionName)).setLyricsIntent(getPendingIntent(lyricsActionName)).setCreateSystemNotification(true).build();
        MusicManager.get().setContext(this).setNotificationCreater(creater).init();
    }
}
Also used : NotificationCreater(com.lzx.musiclibrary.notification.NotificationCreater) CommonRequest(com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest)

Aggregations

NotificationCreater (com.lzx.musiclibrary.notification.NotificationCreater)1 CommonRequest (com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest)1