Issue with onActivityResult in tab activity
Please check this links. May be it is useful for you.
Android onActivityResult NEVER called
How to return a result (startActivityForResult) from a TabHost Activity?
Android Use startActivityForResult from a nested activity in a tab.
camera application gets stuck after taking pic and do not return to my application
Working with files has been chnaged in API 24.
Here is the solution for you:
https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en
When i try to get the Uri from a picture taken with the camera i get null
Android might have killed off (and restarted) your activity before you get into onActivityResult
, for instance because you rotated your device while taking the picture. Try to store and restore outputFileUri
with the rest of the Activity state...
protected void onSaveInstanceState(Bundle outState)
{
outState.putParcelable("outputFileUri", outputFileUri);
}
...
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
if (savedInstanceState != null)
{
outputFileUri= savedInstanceState.getParcelable("outputFileUri");
}
}
Intent chooser stays open when using a Thread to get an image resource
Feeling pretty stupid, but I found the solution.
The issue was in step two: "The Intent chooser automatically opens..."
In order to do this, I was checking to see if a bitmap was available, and if it wasn't then it should display the placeholder image and then open the Intent chooser. I had this logic inside the onStart
method which normally gets run after onActivityResult
. However, because this was all happening asynchronously, I could not rely on this order.
What I had to do was put in a boolean flag which could tell me if we were waiting for a bitmap, and then not open the chooser if we were.
Take photo from camera in fragment
I tried your code its working fine dude. I changed
PhotosListFragment.this.startActivityForResult(intent, 100);
to
getActivity().startActivityForResult(intent, 100);
which after taking the picture, returning back to same activity.
I think both of your fragments are on same activity.
if that is the situation, I suggest you to create a new activity and put the new fragment in there.
Related Topics
Intent Does Not Set the Camera Parameters
Buttons Not Visible on the Application. What's Wrong
How to Import a Native Library (.So File) into Eclipse
Stop Asynctask Doinbackground Method
Most Memory Efficient Way to Resize Bitmaps on Android
View the Task's Activity Stack
What Is the Relationship Between Looper, Handler and Messagequeue in Android
How Can a Divider Line Be Added in an Android Recyclerview
Full Text Search Example in Android
Image Size (Drawable-Hdpi/Ldpi/Mdpi/Xhdpi)
First Letter Capitalization for Edittext
How to Change Line Color in Edittext
Android -- How to Position View Off-Screen
How to Resize the Avd Emulator (In Eclipse)
Understanding Android: Zygote and Dalvikvm
Simple Httpurlconnection Post File Multipart/Form-Data from Android to Google Blobstore