错误的资源价值Android?

时间:2013-09-05 11:56:12

标签: java android android-resources

我正在使用一个Android项目并在我已创建JAR文件的库项目中拥有图像。

JAR文件中可绘制文件夹中的图像序列如下:

image1
image2

现在在我的应用程序中,drawable文件夹具有以下图像序列:

image3
image4
image1

现在,如果我想从图书馆代码As R.drwable.image1中选择drawable,它会从我的Applications Drawable文件夹中选择image3并显示它。

如果image1高于image3,则会正确显示图像。

我不知道为什么我会遇到这个订购问题。我正在使用android SDK版本18.我在eclipse中使用“FatJar”插件创建了一个JAR。

1 个答案:

答案 0 :(得分:0)

即使您选择了R.drawable.image1 ..

,我也不确定为什么会选择image3

但试试这个

R.drwable.image1[1]

<强>更新

NotificationCompat.Builder mBuilder =
        new NotificationCompat.Builder(this)
        .setSmallIcon(R.drawable.icon)
        .setContentTitle("My notification")
        .setContentText("Hello World!");
// Creates an explicit intent for an Activity in your app
Intent resultIntent = new Intent(this, ResultActivity.class);

// The stack builder object will contain an artificial back stack for the
// started Activity.
// This ensures that navigating backward from the Activity leads out of
// your application to the Home screen.
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
// Adds the back stack for the Intent (but not the Intent itself)
stackBuilder.addParentStack(ResultActivity.class);
// Adds the Intent that starts the Activity to the top of the stack
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
        stackBuilder.getPendingIntent(
            0,
            PendingIntent.FLAG_UPDATE_CURRENT
        );
mBuilder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager =
    (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// mId allows you to update the notification later on.
mNotificationManager.notify(mId, mBuilder.build());