简体   繁体   English

startActivity() 在 Android 上无异常工作

[英]startActivity() is not working on Android without exception

In the following code, I can not start the AsyncListImage activity from the TakePicture activity.在以下代码中,我无法从 TakePicture 活动启动 AsyncListImage 活动。

There is no exception during executing.执行过程中没有异常。 The program just went into Looper.loop() as seen from the debugger.从调试器中可以看出,该程序刚刚进入 Looper.loop()。

public class TakePicture extends Activity {

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
        case ImgTaker.PHOTO_PICKED_WITH_DATA: {
            // DO Something with searchResult
            Intent intent = new Intent();
            intent.setClass(this, AsyncListImage.class);
            intent.putExtra("result", searchResult);
            startActivity(intent);
            break;
        }
        case ImgTaker.CAMERA_WITH_DATA: {
            mCurrentPhotoFile = new File(ImgTaker.getPhotoPath());
            ImgTaker.doCropPhoto(this, mCurrentPhotoFile);
            break;
        }
    }
}

}

I do have a declaration of AsyncListImage activity in manifest.xml.我确实在 manifest.xml 中声明了 AsyncListImage 活动。

    <activity android:name=".AsyncListImage"></activity>

In the manifest,try to give the complete path to access the class like "com.stack.example.AsyncListImage"在清单中,尝试提供访问 class 的完整路径,例如“com.stack.example.AsyncListImage”

I finally find out the problem is that the searchResult is too large for binder IPC causing FAILED BINDER TRANSACTION .我终于发现问题是searchResult对于binder IPC 来说太大了导致FAILED BINDER TRANSACTION By limiting the size of searchResult , the issue was fixed.通过限制searchResult的大小,问题得到了解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM