android-intent

Android: how to open image from gallery?

孤人 提交于 2020-01-14 15:27:32
问题 I've created a method in my app that saves my layout as an image and presents it in the gallery. I'm trying to open it but I'm having a hard time with all the tutorials and different approaches... This is my code: SimpleDateFormat mTimeFormat = new SimpleDateFormat("dd-MM-yyyy"); Date mTime = new Date(); String mStringTime = mTimeFormat.format(mTime); String fileFolder = "/orders"; String fileName = "/order-"+mStringTime; File filePath = new File("/sdcard"+fileFolder+fileName+".png"); Uri

Android: how to open image from gallery?

。_饼干妹妹 提交于 2020-01-14 15:26:18
问题 I've created a method in my app that saves my layout as an image and presents it in the gallery. I'm trying to open it but I'm having a hard time with all the tutorials and different approaches... This is my code: SimpleDateFormat mTimeFormat = new SimpleDateFormat("dd-MM-yyyy"); Date mTime = new Date(); String mStringTime = mTimeFormat.format(mTime); String fileFolder = "/orders"; String fileName = "/order-"+mStringTime; File filePath = new File("/sdcard"+fileFolder+fileName+".png"); Uri

Android - Sending TXT File as Attachment to Email Fails (“Couldn't send attachment”)

梦想的初衷 提交于 2020-01-14 14:32:08
问题 I am trying to get my Android app to send an e-mail with a file attached, and I'm starting out with a .txt file, since those are simple. So far I have this (taking place inside a Fragment): //Send the email Intent mailIntent = new Intent(Intent.ACTION_SEND); mailIntent.setType("text/Message"); mailIntent.putExtra(Intent.EXTRA_EMAIL , new String[]{address}); mailIntent.putExtra(Intent.EXTRA_SUBJECT, "Test Email"); mailIntent.putExtra(Intent.EXTRA_TEXT , "Hi! This is a test!"); //Deal with the

Pass model object to another Activity

时光总嘲笑我的痴心妄想 提交于 2020-01-14 14:17:07
问题 I have a RecyclerView that utilizes a Recycler Adapter to output a list layout, like this: http://i.imgur.com/ORkXXTb.png I need to attach the model below to each of the list items, such that if the user clicks on any element in the list item (like the circle or one of the two TextViews), it passes the model object to the next Activity . Here is the User model: public class User { private String id; private String username; private String displayName; private Object deletedAt; private

Takes long time to open in custom camera android?

你。 提交于 2020-01-14 14:11:51
问题 Hi I am working in custom camera. I used CameraPreview class from git. Everything works fine but problem is when i open camera from Activity A, it takes 4 seconds to open the camera. I am not getting any error. But getCameraInstance method calling takes long time to open the camera. How to reduce 4 seconds delay when opening the camera? I have clueless how to reduce the delay to go to TakePhotoFragment. Please help me to solve the issue Here is CameraPreview: public class CameraPreview

Android: How to Resume Application/Activity from BroadcastReceiver?

半腔热情 提交于 2020-01-14 13:04:32
问题 If my procedure is following: Launch Activity A -> Activity B Press 'Home' button. Click on the application again. Result: 'Activity B' shows up (it resumes ). Launch Activity A -> Activity B Press 'Back' button. Click on the application again. Result: 'Activity A' shows up (it restarts ). I want to do exactly same from the BroadcastReceiver. Launch Activity A -> Activity B Press 'Home' button. BroadcastReceiver receives a broadcast and want to "resume" application. My expected result:

Android: How to Resume Application/Activity from BroadcastReceiver?

浪尽此生 提交于 2020-01-14 13:04:18
问题 If my procedure is following: Launch Activity A -> Activity B Press 'Home' button. Click on the application again. Result: 'Activity B' shows up (it resumes ). Launch Activity A -> Activity B Press 'Back' button. Click on the application again. Result: 'Activity A' shows up (it restarts ). I want to do exactly same from the BroadcastReceiver. Launch Activity A -> Activity B Press 'Home' button. BroadcastReceiver receives a broadcast and want to "resume" application. My expected result:

Android: How to Resume Application/Activity from BroadcastReceiver?

六月ゝ 毕业季﹏ 提交于 2020-01-14 13:04:01
问题 If my procedure is following: Launch Activity A -> Activity B Press 'Home' button. Click on the application again. Result: 'Activity B' shows up (it resumes ). Launch Activity A -> Activity B Press 'Back' button. Click on the application again. Result: 'Activity A' shows up (it restarts ). I want to do exactly same from the BroadcastReceiver. Launch Activity A -> Activity B Press 'Home' button. BroadcastReceiver receives a broadcast and want to "resume" application. My expected result:

Open a specific fragment of activity A from activity B

怎甘沉沦 提交于 2020-01-14 12:32:54
问题 Here again! The situation is this, I have: Activity A that implements a viewPager and visualizes 3 possible fragments. To access to each fragment I use this code: @Override public Fragment getItem(int page) { switch (page) { case 0: return new MyFirstFragment(); case 1: return new MySecondFragment(); case 2: return new MyThirdFragment(); } return null; } @Override public int getCount() { return [the count of total fragments]; } Fragment 3 contains a list of users. When I click on a user

Send Image and Text both using ACTION_SEND or ACTION_SEND_MULTIPLE

こ雲淡風輕ζ 提交于 2020-01-14 12:22:10
问题 - We have tried to post image and text using the below code: final Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); shareIntent.setType("image/png"); shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse("file:///mnt/sdcard/UserImages/"+ ParseUser.getCurrentUser().getObjectId() + ".png")); shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,"Hello test"); startActivity(Intent.createChooser(shareIntent,"Share")); - We have also tried using