android-intent

What's App multiline text share intent

我与影子孤独终老i 提交于 2021-01-28 06:05:28
问题 I tried to share a multi-line text using the following code, but only the last line appears. val sharingIntent = Intent(Intent.ACTION_SEND) sharingIntent.setType("text/plain") sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Found this cool deal! Check it out.") sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, TITLE) sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "MRP : $PRICE") sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Deal Price : $DEAL_PRICE")

What's App multiline text share intent

核能气质少年 提交于 2021-01-28 06:03:16
问题 I tried to share a multi-line text using the following code, but only the last line appears. val sharingIntent = Intent(Intent.ACTION_SEND) sharingIntent.setType("text/plain") sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Found this cool deal! Check it out.") sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, TITLE) sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "MRP : $PRICE") sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Deal Price : $DEAL_PRICE")

How to close all activities in Android and close from Task Manager?

送分小仙女□ 提交于 2021-01-28 05:57:24
问题 I want close android app int id= android.os.Process.myPid(); android.os.Process.killProcess(id); This code kills the Process. 回答1: If you always want your app to start with the root activity (the first activity) every time the user launches the app from the home screen or returns to it from the list of recent apps, then add this to the manifest in the <activity> tag for your root activity: android:clearTaskOnLaunch="true" However, if you want to just finish all activities in the current task

Xamarin android - take picture from camera then pass it to other activity

柔情痞子 提交于 2021-01-28 05:27:04
问题 I am new to xamarin and I want to take a picture from the camera when I click on a button on my mainactivity and then, once the picture taken, display it in an imageView in an other activity. Can you help me? Here's what I have right now : MainActivity : costsButton.Click += delegate { Intent intent = new Intent(MediaStore.ActionImageCapture); StartActivityForResult(intent, 0); }; protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { base.OnActivityResult

Launching Huawei Petal Maps Directions via Intent on Android

≯℡__Kan透↙ 提交于 2021-01-28 04:15:57
问题 Is it possible to launch Huawei Petal Maps with navigation from point A to point B using intent just like in google maps? If yes, how? 回答1: Yes, you can use an intent to launch the Petal Map app, and then use navigation functions in the app. Deep link example: mapapp://navigation?saddr=xxx&daddr=xxx&language=xx&type=xxx mapapp://navigation?saddr=home&daddr=company&language=en&type=drive mapapp://navigation?type=exit To use this function, you need to set uriString to the following: "mapapp:/

Starting ANY of the installed apps

时光总嘲笑我的痴心妄想 提交于 2021-01-27 20:43:18
问题 i have and app in which the user can scroll through a list of all installed apps and he can pick any app and starts it. For most Apps this works fine with: startActivity(getPackageManager().getLaunchIntentForPackage(packageName_selectedapp)); where packageName_selectedapp is the string of the selected app from the list. BUT for some apps the function getLaunchIntentForPackage(packageName_selectedapp) returns "null", for instance if it is the dialer or contacts activity. How can i get the

Android: Sending an object from one activity to other activity

我的梦境 提交于 2021-01-27 19:21:44
问题 To send intent with any object from one activity to another activity we can use Parcelable Interface or Serializable Interface. What is the difference between two? Which one is preferable to use? Moreover, we can send string, integer type of object without using all this Interface. How it is possible? 回答1: Java Serializable: Serializable comes from standard Java and is much easier to implement all you need to do is implement the Serializable interface and add override two methods. private

How to call getIntent() in adapter class

て烟熏妆下的殇ゞ 提交于 2021-01-27 14:08:47
问题 In getView() method I want to call getIntent(). How can I achieve this without starting a new activity. The getView method like this public View getView(final int position, View convertView, ViewGroup parent) { PaymentData rowItem = getItem(position); LayoutInflater mInflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (convertView == null) { convertView = mInflater.inflate( com.android.paypal.homeactivity.R.layout.list_item, null); holder = new

Launching an App from a URL

 ̄綄美尐妖づ 提交于 2021-01-27 13:45:10
问题 I am attempting to get the Android application chooser to launch when a specific URL is clicked from within a registration e-mail. I have already looked at the below question and several others but I am still having no luck with this. Launching Android Application from link or email I have created my intent in the AndroidManifest.xml file as below (I've placed my website address where you see ".website.org"): <activity android:name=".MainActivity" android:configChanges="orientation|screenSize

sending data from activity to Intentservice

☆樱花仙子☆ 提交于 2021-01-27 13:26:56
问题 my needs is to send data from activity to IntentService (from class that extends activity, to class that extends IntentService) i successed to send to sample service, by using BroadcastReciver, but i want to extend IntentService class and not service someone know how can i do that? from public class MainActivity extends Activity { ... } to public class MyIntentService extends IntentService { ... } 回答1: Put the data in an Intent extra that you use with the startService() call to start your