android-intent

How to store/restore activity state when moving/navigating back

筅森魡賤 提交于 2019-12-23 21:18:22
问题 How can I save activity state (B) when moving to previous activity (A) and how to restore it's previous state when moving back (to activity B)? SCENARIO Content of activity B can be changed by user. After finishing work, performed changes can be persisted (e. g. saved to local DB). Before persisting, user may want to navigate back to previous activity. At this point, "work session" should be somehow saved temporary in memory . After returning back to activity B "work session" should be

Android intent Street View does not work anymore

老子叫甜甜 提交于 2019-12-23 20:56:00
问题 i used to launch an intent from my app to Maps to display a street view panorama. Since some days when i launch the intent Maps says : "Street View isn't available here". I try to run a new project with only the intent as Google says: Uri gmmIntentUri = Uri.parse("google.streetview:cbll=46.414382,10.013988"); Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); mapIntent.setPackage("com.google.android.apps.maps"); startActivity(mapIntent); but i receive the same message. The same

Android Browser Intent back button

耗尽温柔 提交于 2019-12-23 19:13:38
问题 Hello I am lauching the browser from my application using an intent such as: String url = "XXXX"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); but when I press back on the browser i want to go back to the my application, instead of going to the options of the browser. how can i control this behaviour? 回答1: You can't as the back button implementation is now under control of Browser Application . Implement a WebView in your application and handle Back

How to open my application when app link is clicked?

流过昼夜 提交于 2019-12-23 18:56:51
问题 What I want is to share the link of specific page of my application. Suppose I am in a profile page of some user in my app and I want to share that user to some of my friends so I would like to share it via WhatsApp and other applications. So basically I want to share a link to my app. This is what I am doing right now Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "https://play

Launching Messaging application with a body text

感情迁移 提交于 2019-12-23 17:43:55
问题 i have this code to open the messaging. i wanna add body text into it Intent i6 = new Intent(Intent.ACTION_VIEW, Uri .parse("sms:9986377561")); startActivity(i6); add body text body: test text 回答1: Intent sendIntent = new Intent(Intent.ACTION_VIEW); sendIntent.putExtra("sms_body", "The SMS text"); sendIntent.putExtra("address", "phoneNumber1;phoneNumber2;..."); sendIntent.setType("vnd.android-dir/mms-sms"); startActivity(sendIntent); 来源: https://stackoverflow.com/questions/4384174/launching

How to check if an editText box(s) is empty or not in android using Java [duplicate]

筅森魡賤 提交于 2019-12-23 17:31:45
问题 This question already has answers here : Check if EditText is empty. [closed] (30 answers) Closed 3 years ago . In my app, I have around 5 editText boxes in every screen.I want to check if they are empty or not and if all the text boxes are not empty, then there is an intent which takes you to the next screen. I want to know what code to write. 回答1: Just add this code in your java file when you want to call the intent. EditText editTextBox1 = (EditText) findViewById(R.id.your_editTextBox1_id)

Do Intent extras have to be removed?

怎甘沉沦 提交于 2019-12-23 17:28:07
问题 This might be a stupid question, but is there a rule that states that intent extras have to be explicitly removed by the consuming activity, or is that only true if you're recycling Intent objects? Put another way, if I always chain to the next activity by doing something like: Intent i = new Intent(MyCurrentActivity.this, FooActivity.class); i.putExtra("first", "stringvalue"); i.putExtra("second", 69L); startActivity(i); then, in FooActivity, I read them back out... String first = getIntent(

Invoke android application from browser

落花浮王杯 提交于 2019-12-23 17:25:44
问题 I have been trying to invoke my application from browser on android 3.1 (Honeycomb) These are the links I tried, but none of these worked: <a href="com.nk.myapp://movieid=95319">click me 1</a> <a href="intent:#Intent;action=com.nk.myapp.detail;end">click me 2</a> <a href=intent:#Intent;action=com.nk.myapp.detail;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;package=com.nk.myapp;end>click me 3</a> For 1st and 2nd url, it gives "Webpage not available". For

Sending email using standard gmail app without chooser

微笑、不失礼 提交于 2019-12-23 17:06:57
问题 I'm trying send email from my app using standard gmail app. But I get chooser all the time. How can I open standard gmail app immediately without chooser? I don't need a chooser with any application which can send email. I need only GMAIL. Thank you! Here is my code. Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("message/rfc822"); intent.setClassName("com.google.android.gm", "com.google.android.gm.ConversationListActivity"); intent.putExtra(Intent.EXTRA_EMAIL , new String[]{

open application After incoming or outgoing call diconnection

大憨熊 提交于 2019-12-23 16:34:12
问题 I am creating an application, where I am getting call history in a listview , now what I am trying is after any incoming or outgoing call disconnection,I want to open that listview , but I don't know my app is not opening. my listview page is not displayed after any call, following is my code public class MainActivity extends Activity { private ListView listview=null; private String callType=null; private String phoneNumber=null; private String callDate=null; private String callDuration=null;