简体   繁体   中英

startActivity() is not working on Android without exception

In the following code, I can not start the AsyncListImage activity from the TakePicture activity.

There is no exception during executing. The program just went into Looper.loop() as seen from the debugger.

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.

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

In the manifest,try to give the complete path to access the class like "com.stack.example.AsyncListImage"

I finally find out the problem is that the searchResult is too large for binder IPC causing FAILED BINDER TRANSACTION . By limiting the size of searchResult , the issue was fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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