android-intent

Android share Intent with clickable link

梦想与她 提交于 2020-01-06 01:30:09
问题 I have looked around the web but have yet to find a solution that fits my specific need. I am looking for a way to share information with a share intent that provides a clickable link, something like: Check out this news article via Jimmy's News App I have successfully set up a share intent in my android app which looks like this: Intent shareIntent = new Intent(); shareIntent.setAction(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject Text"); shareIntent.putExtra

How to pass ArrayList<Custom_Object> from one activity to another in Android?

萝らか妹 提交于 2020-01-05 21:04:32
问题 I am trying to send a custom object from one activity to another activity, but it's crashing when I call the start activity. Below is the snippet I used. My Activity implements Serializable ArrayList<CUSTOM_OBJECT> Cus_Obje_arraylist = new ArrayList<CUSTOM_OBJECT>(); Here is my intent : Intent inte = new Intent(getApplicationContext(), ListActivity.class); ` inte.putExtra("list",Cus_Obje_arraylist);` startActivity(inte); Please let me know why it's crashing or what alternate way I can use?

How to access an image that is stored internally

眉间皱痕 提交于 2020-01-05 19:39:10
问题 I have an application that takes a picture and stores the picture internally in a folder that I have created. After taking a picture I want to be able to access it so that I can email it. How can I access the image I have just taken?Below is my code that saves the image internally after the picture has been taken: protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { Bundle extras =

How to access an image that is stored internally

丶灬走出姿态 提交于 2020-01-05 19:38:09
问题 I have an application that takes a picture and stores the picture internally in a folder that I have created. After taking a picture I want to be able to access it so that I can email it. How can I access the image I have just taken?Below is my code that saves the image internally after the picture has been taken: protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { Bundle extras =

Android how to close an intent?

谁说我不能喝 提交于 2020-01-05 16:47:10
问题 I've created an intent using browserIntent =new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)); How do I close it? Is it browserIntent.close or something... perhaps browserIntent.finish(); ? 回答1: You cannot close another application's activities. 回答2: You can't. Your intent starts a new application - browser. You can not close that application (browser) from with your activity. Workarounds: You could however put you activity in front from a service (call intent on your activity). The question

Add Items to an ArrayList<String> that has been passed between Activities

帅比萌擦擦* 提交于 2020-01-05 12:12:30
问题 I have Looked around here on StackOverflow and the internet and tried a few things but all of them are giving me the same general problem. I have an ArrayList that I create in one activity and then send it through (another activity or 2 others depending on the users choices) and in each activity (including the one that the arraylist is created in) has the user select a single button from a group. Upon selecting the button I have a listener that creates a simple string and then adds that

public static hashmap clear and put not work properly [closed]

扶醉桌前 提交于 2020-01-05 11:56:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . At first I click the “mn_column” button, then works properly. But I go back and click again “mn_column” or “mn_blog” then it show flowing error : 08-10 02:30:16.441: E/AndroidRuntime(1098): FATAL EXCEPTION: main 08-10 02:30:16.441: E/AndroidRuntime(1098): Process: com.sams.main.news, PID: 1098 08-10 02:30:16.441

Android Intent Service implementing SensorEventListener

我的未来我决定 提交于 2020-01-05 10:16:13
问题 I have a question about IntentService in Android. I define my own service as below: public class ABC extends IntentService implements SensorEventListener { @Override protected void onHandleIntent(Intent intent) { } @Override public void onSensorChanged(SensorEvent event) { } } Now if i start the service from other activity, onHandleIntent() is invoked. Documentation says it launches a worker thread to process the request. However, when onSensorChanged() method is invoked, which thread will be

Android: determining the current context to display an alert

百般思念 提交于 2020-01-05 08:24:07
问题 I am calling the ZXing scanner from Screen-A using Intent s. Once the scan is done, control returns, of course, to the code behind Screen-A and I do some other work before calling Screen-B. Problem is: the screen is black during this work period and I cannot determine the proper context to use to display a "working..." Toast/msgbox. Any help or suggestions? 回答1: Execute your " work period " in it's own thread , while that thread works in the background Android will pass control to Screen-A

Why does the main activity restart again after its called intent finished (Android 4.2.2)?

﹥>﹥吖頭↗ 提交于 2020-01-05 07:57:12
问题 The application works well in Android 2.3.5 But it does not work as desired in Nexus 4 (Android 4.2.2). The application is: In the onCreate of main activity, it calls another activity through intent. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Intent launchIntent = new Intent(MainActivity.this, AndroidVideoCapture.class); launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP)