Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android SampleDownloaderActivity类强制转换异常_Android - Fatal编程技术网

Android SampleDownloaderActivity类强制转换异常

Android SampleDownloaderActivity类强制转换异常,android,Android,我正在实现obb文件下载,但我的活动崩溃了我从sdk下载了示例代码,并使用了其中包含的活动SampleDownloaderActivity,但它崩溃了,并创建了classCast异常。我在中的活动是通过IDownloaderClient实现的 @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /** * Both down

我正在实现obb文件下载,但我的活动崩溃了我从sdk下载了示例代码,并使用了其中包含的活动SampleDownloaderActivity,但它崩溃了,并创建了classCast异常。我在中的活动是通过IDownloaderClient实现的

   @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    /**
     * Both downloading and validation make use of the "download" UI
     */
    initializeDownloadUI();

    /**
     * Before we do anything, are the files we expect already here and
     * delivered (presumably by Market) For free titles, this is probably
     * worth doing. (so no Market request is necessary)
     */
    if (!expansionFilesDelivered()) {

        try {
            Intent launchIntent = SampleDownloaderActivity.this
                    .getIntent();
            Intent intentToLaunchThisActivityFromNotification = new Intent(
                    SampleDownloaderActivity
                    .this, SampleDownloaderActivity.this.getClass());
            intentToLaunchThisActivityFromNotification.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
                    Intent.FLAG_ACTIVITY_CLEAR_TOP);
            intentToLaunchThisActivityFromNotification.setAction(launchIntent.getAction());

            if (launchIntent.getCategories() != null) {
                for (String category : launchIntent.getCategories()) {
                    intentToLaunchThisActivityFromNotification.addCategory(category);
                }
            }

            // Build PendingIntent used to open this activity from
            // Notification
            PendingIntent pendingIntent = PendingIntent.getActivity(
                    SampleDownloaderActivity.this,
                    0, intentToLaunchThisActivityFromNotification,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            // Request to start the download
            int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(this,
                    pendingIntent, DownloaderService.class);

            if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
                // The DownloaderService has started downloading the files,
                // show progress
                initializeDownloadUI();
                return;
            } // otherwise, download not needed so we fall through to
              // starting the movie
        } catch (NameNotFoundException e) {
            Log.e(LOG_TAG, "Cannot find own package! MAYDAY!");
            e.printStackTrace();
        }

    } else {
        validateXAPKZipFiles();
    }

}

@现在看看这个Rana:第418行@ρѕѕρєK DownloaderClientMarshaller.startdownloadserviceifrequired这个,pendingent,DownloaderService.class是什么;这条线