Android Maven TaskStackBuilder找不到符号

时间:2013-03-25 19:34:00

标签: android maven

我正在尝试使用类 TaskStackBuilder 解决此错误:“找不到符号”。我使用Travis-ci也有这个问题:https://travis-ci.org/melchor629/Musicote-Melchor629 以maven为目标的代码错误是:

    int mID = 1;

    NotificationCompat.Builder notification = new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.altavoz)
            .setContentTitle("Musicote")
            .setContentText("Reproduciendo "+titulo+" de "+artista)
            ;//TODO poner que sea fijo

    Intent resultIntent = new Intent(this, MainActivity.class);

    TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
    stackBuilder.addParentStack(MainActivity.class);
    stackBuilder.addNextIntent(resultIntent);
    PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
    notification.setContentIntent(resultPendingIntent);
    nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    nm.notify(mID, notification.build());

我没有任何想法要解决这个问题,我尝试了所有我知道的:我正在使用“android.support.v4.TaskStackBuilder”

1 个答案:

答案 0 :(得分:0)

您使用的是v4支持库吗?如果是这样,你导入正确的TaskStackBuilder(android.support.v4.app.TaskStackBuilder)吗?