Activity killed / onCreate called after taking picture via intent
Actually the camera causes the orientation change in your activity that is why your activity is being destroyed and recreated.
Add this in your manifest file it will prevent the orientation change and your activity will not get destroyed and recreated.
<activity
android:name=".YourActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" >
</activity>
onCreate called before and after onActivityResult
Actually the camera causes the orientation change in your activity that is why your activity is being destroyed and recreated.
Add this in your manifest file it will prevent the orientation change and your activity will not get destroyed and recreated.
<activity
android:name=".YourActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
</activity>
Activity killed / onCreate called after taking picture via intent
Android - Activity seems to not get called after the intent returns
Every picture you add, gets converted to a byte[] array, and gets stored as an extra in the result intent.
That is a really bad idea.
though no errors can be found in the logs
You are probably getting "FAILED BINDER TRANSACTION" warnings.
Any reason why this might be happening ?
My guess is that you are attempting to pass too much data via IPC. The Intent
that you supply to setResult()
is passed from your app to a core OS process, then back to your app and the caller of startActivityForResult()
. At best, you can pass 1MB in an IPC transaction, and depending on what else is going on at the time, the limit may be substantially lower.
Either:
Have one activity, not two, by using fragments for the individual bits of UI and using a shared
ViewModel
to expose the results of one fragment to another; orCarefully hold onto these images in a shared cache, so you are passing cache keys as extras, not
byte[]
; orFind some other architecture that you like that does not involve putting large
byte[]
values into anIntent
for use withstartActivity()
,startActivityForResult()
, orsetResult()
Related Topics
Android:Change Button Text and Background Color
Sqlite Query in Android to Count Rows
Multiple Apps Use Same Content Provider
Android: Custom Separator (Or Even Item) in Listview Depening on Content of Item
Android Camera: Onactivityresult() Intent Is Null If It Had Extras
Android Fragmenttransaction Custom Animation (Unknown Animator Name: Translate)
Change Device Language via Adb
How to Show/Hide Password in Textformfield
Updated Sdk Version, Getting Classnotfoundexception: Android.Support.V4.View.Viewpager
How Can Retrofit 2.0 Parse Nested JSON Object
How to Change Action Bar Actions Dynamically
Page Scroll When Soft Keyboard Popped Up
How to Fix "Fail to Connect to Camera Service" Exception in Android Emulator