2

我正在使用一个 android 项目并在一个库项目中有图像,我已经为其创建了一个 JAR 文件。

JAR 文件中 drawable 文件夹中的图像序列如下:

image1
image2

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

image3
image4
image1

现在,如果我想从库代码中选择可绘制对象作为 R.drwable.image1,它会从我的应用程序可绘制文件夹中选择 image3 并显示它。

如果 image1 高于 image3 它会正确显示它的图像。

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

4

1 回答 1

0

我不确定为什么它会选择 image3,即使你选择了R.drawable.image1..

但试试这个

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());
于 2013-09-05T12:09:46.117 回答