onactivityresult

doesn't show picture in android 6 and above

对着背影说爱祢 提交于 2020-01-27 08:46:25
问题 I am trying to learn how to use the camera in an app and this is what I reached , the idea is having a button that opens the camera and that the picture will instantly show on the screen after we take the picture, the second button is from an earlier version that couldn't show the picture immediately and had to be clicked in order to show it. Anyways my problem is that this code doesn't show the picture at android 6.. on my android 5 device it works fine.. the picture is saved in the "sdcard

how to update a specific item (cardview) in recyclerview OnActivityResult

荒凉一梦 提交于 2020-01-24 19:40:25
问题 I have a Fragment inside MainActivty, and inside this Fragment RecyclerView of Articles with cardView (inside this card i have like button and like counter) and when the user click on the cardView will open DetailsActivity that and I want when onBackPressed to update just this item depends on the data changed (like button and like counter) in DetailsActivity how to update just this Item ? sorry for bad English! 回答1: First update the data of that specific position item of adapter. After that

how to update a specific item (cardview) in recyclerview OnActivityResult

两盒软妹~` 提交于 2020-01-24 19:40:06
问题 I have a Fragment inside MainActivty, and inside this Fragment RecyclerView of Articles with cardView (inside this card i have like button and like counter) and when the user click on the cardView will open DetailsActivity that and I want when onBackPressed to update just this item depends on the data changed (like button and like counter) in DetailsActivity how to update just this Item ? sorry for bad English! 回答1: First update the data of that specific position item of adapter. After that

onActivityResult for Intent(Settings.ACTION_SETTINGS) called immediately

亡梦爱人 提交于 2020-01-23 10:08:44
问题 In my splash screen I have request to server, but when there's no internet connection i'm opening Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS); startActivityForResult(settingsIntent, REQUEST_ENABLE_CONNECTION); But problem is that onActivityResult is called immediately with requestCode = REQUEST_ENABLE_CONNECTION I've also tried to add the flag FLAG_NEW_TASK for the intent with no luck. The activity is not singleTop or singleInstance in the manifest . What is the best android

how to start google map for result

喜你入骨 提交于 2020-01-23 01:55:19
问题 I want my user to enter an address. But I want the address to be confirmed with Google Map. So when the user clicks on a button to enter the address, I want to launch an Intent for Google Map where user can enter the address. But then I want the map to return the data to me. How do I do that? If I start my activity as Uri searchUri = Uri.parse("geo:0,0?z=10&q="); Intent mapIntent = new Intent(Intent.ACTION_VIEW,searchUri); mapIntent.setPackage("com.google.android.apps.maps");

How to manage activity with startActivityForResult

无人久伴 提交于 2020-01-20 08:51:10
问题 I got a situation like this: Activity A --> B --> C --> D, when D finished, I have to refresh ActivityA to display what I input in ActivityB , ActivityC and ActivityD.Here is my code: ActivityA @OnClick(R.id.btn_one) public void toActivityB(){ Intent intent = new Intent(); intent.setClass(this, ActivityB.class); startActivityForResult(intent, 1); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data);

WRONG onActivityResult() being called

浪子不回头ぞ 提交于 2020-01-17 12:46:05
问题 I have 2 activities A, B and both are using onActivityResult() in them. The process: onActivityResult() in A works fines. I have two onActivityResult() (shown in code below) in Activity B .First one as a clickable TextView which is also working fine. The other as Button . The problem I'm facing is in the Button which is suppose to bring a Bitmap from sub-activity of B and display in a ImageView in B. . When I click the Button it takes me to the onActivityResult() of the Activity A.

Cropping captured image is blur in android

时光总嘲笑我的痴心妄想 提交于 2020-01-15 12:38:07
问题 Hi basically I am selecting image form gallery or capture from camera and cropping it. If I crop image which is selected from gallery is no blur its fine but if I crop captured images means its getting blur. To start camera I have used private void cameraIntent() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, REQUEST_CAMERA); } and in camera onActivityResult private void onCaptureImageResult(Intent data) { Bitmap bm = (Bitmap) data.getExtras()

onActivityResult returning Intent data.getData(); always Null Only in Marshmallow and Lollipop

老子叫甜甜 提交于 2020-01-11 04:10:07
问题 Read My Whole Code. It is working perfectly on every Phone except Marshmallow and Lollipop . In Marshmallow and Lollipop phones Only problem is coming in data.getData() returning null only in case of Picture Captured . It is working fine if i capture Video .I have 4 cases - Choosing Picture from Gallery and show its thumbnail in Imageview - Working Fine. Capturing Picture from Camera and show its thumbnail in Imageview - NOT WORKING in Marshmallow and Lollipop . Choosing Video from Gallery

Android: how to make an activity return results to the activity which calls it?

谁都会走 提交于 2020-01-08 17:14:13
问题 I have a Location activity that can be called from many activities, such as Sign up and Order . In the Location activity the user enters his location, so the activity Location will return this new location to that activity which called it. So when the Sign up activity calls the Location activity, it has to return the data to the Sign up activity. Another time the Order activity will do the same thing. Note I know you will tell me that I should post the code, but I am not asking you to give me