android-implicit-intent

How to get back to initial app where the implicit intent is started?

给你一囗甜甜゛ 提交于 2019-12-11 07:16:57
问题 I have an app which contain some buttons.some of these buttons open specific URL/address by android internet browser and close my app(implicit intent). but i want this, when user close internet browser android redirect user to my app automatically. my button code is: case R.id.btnB: Uri myurl1 = Uri.parse("http://www.justandroid.com/"); Intent intent_B = new Intent(Intent.ACTION_VIEW, myurl1 ); startActivityForResult(intent_B,8); break; case R.id.btnC: Uri myurl2 = Uri.parse("http://www

What does it mean when two or more activities, each having intent-filter with action=android.intent.action.ACTION_MAIN?

三世轮回 提交于 2019-12-11 06:37:24
问题 Doc says https://developer.android.com/reference/android/content/Intent.html#ACTION_MAIN is an entry point. Example code: <activity android:name="org.A.A" android:theme="@style/NoTitle" android:screenOrientation="behind" android:launchMode="singleTask"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> <activity android:name="org.A.C" android:theme="@style/NoTitle" android:launchMode="singleTop" android:screenOrientation="behind"> <intent-filter

Android : Message Intent

吃可爱长大的小学妹 提交于 2019-12-01 04:18:52
I'm a beginner to android. I need to know is there any intent to open the Create Message window. I tried with this code - Intent i = new Intent(Intent.ACTION_SEND); i.setType("text/plain"); But, it raises, Gmail, Email & Message I need to raise only message. In my application i've to integrate this when i press the button. Can anybody know this? Guide me. You can just in your xml file add android:onClick = "onClick" and in activity: //main buttons listener public void onClick(View view) { switch (view.getId()) { case R.id.sms: Intent intentsms = new Intent( Intent.ACTION_VIEW, Uri.parse( "sms:

Android : Message Intent

回眸只為那壹抹淺笑 提交于 2019-12-01 02:14:49
问题 I'm a beginner to android. I need to know is there any intent to open the Create Message window. I tried with this code - Intent i = new Intent(Intent.ACTION_SEND); i.setType("text/plain"); But, it raises, Gmail, Email & Message I need to raise only message. In my application i've to integrate this when i press the button. Can anybody know this? Guide me. 回答1: You can just in your xml file add android:onClick = "onClick" and in activity: //main buttons listener public void onClick(View view)

Activity exported=false listed in activity chooser

点点圈 提交于 2019-11-29 22:41:24
问题 I have two similar applications (one free, one paid). An activity is defined with exported="false" <activity android:name=".MyActivity" android:exported="false" android:noHistory="true" > <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.item/vnd.mine" /> </intent-filter> </activity> When I call startActivity with the appropriate implicit intent from the free app, the

Sending a SMS Message from an Android Application without opening chooser?

故事扮演 提交于 2019-11-29 12:35:00
In my android application I have implemented sending SMS by using below code. Intent smsIntent = new Intent(Intent.ACTION_VIEW); smsIntent.putExtra("sms_body", "Hello World!"); smsIntent.putExtra("address", "0123456789"); smsIntent.setType("vnd.android-dir/mms-sms"); startActivity(smsIntent); My problem is that if I have more than one SMS application on the device, it opens the chooser to choose the sender application. I don't want the chooser to be opened; I want to send from Android's native SMS app without opening the chooser. So any help to achieve this will be appreciated. Use the SMS

Pick contact directly from contact picker intent

随声附和 提交于 2019-11-29 06:15:05
Hello I want to pick a contact from our default contact book intent. I tried several ways to do it. Please find the code below. The problem with all those code is that they open one intermediate documents screen with few options there user has to select contact and than it opens contact book. private void openContactIntent() { Intent intent = new Intent(Intent.ACTION_GET_CONTENT, ContactsContract.Contacts.CONTENT_URI); intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE); startActivityForResult(intent, REQ_CONTACT_DIRECTORY); } I also tried Intent intent = new Intent(Intent

Call intent in Android

主宰稳场 提交于 2019-11-29 04:28:54
How can I make call by pressing button? I get my number as a string from EditText . Here is my sample code: String phone = editPhone.getText().toString(); btnPhone.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { call(); } }); public void call() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse(phone)); startActivity(callIntent); } catch (ActivityNotFoundException activityException) { Log.e("myphone dialer", "Call failed", e); } } I added all permissions to manifest file. but I am getting NullPointerexception This

Implementing a File Picker in Android and copying the selected file to another location

谁说我不能喝 提交于 2019-11-28 21:26:09
I'm trying to implement a File Picker in my Android project. What I've been able to do so far is : Intent chooseFile; Intent intent; chooseFile = new Intent(Intent.ACTION_GET_CONTENT); chooseFile.setType("*/*"); intent = Intent.createChooser(chooseFile, "Choose a file"); startActivityForResult(intent, PICKFILE_RESULT_CODE); And then in my onActivityResult() switch(requestCode){ case PICKFILE_RESULT_CODE: if(resultCode==-1){ Uri uri = data.getData(); String filePath = uri.getPath(); Toast.makeText(getActivity(), filePath, Toast.LENGTH_LONG).show(); } break; } This is opening a file picker, but

Android implicit intents VS explicit intents

爱⌒轻易说出口 提交于 2019-11-27 18:05:31
Working with android I realized that implicit intents are good choice in most of cases due to their's flexibility. But what's about explicit intents? What are benefits of using them? What are common cases when it's a good practice to use them? Aditya Kamath Implicit Intents do not directly specify the Android components which should be called, it only specifies action to be performed. A Uri can be used with the implicit intent to specify the data type. for example Intent intent = new Intent(ACTION_VIEW,Uri.parse("http://www.google.com")); this will cause web browser to open a webpage. Android