android-intent

Android AlarmClock search by label

99封情书 提交于 2020-01-04 07:58:06
问题 I want to use an Intent with android.provider.AlarmClock to dismiss (ACTION_DISMISS_ALARM) an specific Alarm. I want to use ALARM_SEARCH_MODE_LABEL to select the alarm. However, I have no idea how I can set the label to search for. Intent i = new Intent(AlarmClock.ACTION_DISMISS_ALARM); i.putExtra(AlarmClock.EXTRA_ALARM_SEARCH_MODE, AlarmClock.ALARM_SEARCH_MODE_LABEL); startActivity(i); Can someone help me complete the code? 回答1: Seems like it is: intent.putExtra(AlarmClock.EXTRA_MESSAGE,

maximum image selection limit from gallery Android

给你一囗甜甜゛ 提交于 2020-01-04 07:53:08
问题 I am trying to get image's Uri in the Gallery built-in app from inside my application. so, I was using the Intent below, but it selected many more image. i want to set limitation. less than 3 @Override public void onClick(View v) { Intent intent = new Intent( ); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); startActivityForResult(Intent.createChooser(intent, "select images"), PICK_IMAGE_MULTIPLE); } how do i fix

How to get data onActivityResult from external App Activity using seResult or startActivityForResult

放肆的年华 提交于 2020-01-04 07:01:29
问题 I have two application separately.Client and Seller App. I want to pay money for client app and get response to seller app. Anyway,i have deep linking concept enabled in seller app. Client App : It has three Activity Page inside client app.getting details(first activity page) and show confirmation(second activity) and payment is third Activity. Note:Open Client App using Seller App, fill all details and payment from client app and send response to Seller App. for this client side i have set

Can't put extras for an intent in notification

余生颓废 提交于 2020-01-04 05:05:26
问题 I'm creating a notification from a Service that has an intent with an extra integer. For some reason, this isn't as easy as it seems. This is what I'm doing: Notification notification = new Notification(R.drawable.notification_icon, "Title", 0); Intent relaunchIntent = new Intent(this, SomeClass.class); relaunchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); relaunchIntent.putExtra("load", getId()); notification.setLatestEventInfo(this, "Title", "Tap here to open", PendingIntent.getActivity

Android : Permission Denied Error when changing Launcher Activity

家住魔仙堡 提交于 2020-01-04 02:54:18
问题 I have an android app that I am trying to launch and it gives me the error java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.hoosierag/.MainActivity } from null (pid=32395, uid=2000) not exported from uid 10125 I get this error when I try to change the launcher activity in the manifest. Also I dont get this error when I launch it on the emulator, but when I try to launch it on a device

Attaching an drawable image to email in android

北城以北 提交于 2020-01-03 21:05:47
问题 I have a list of Drawable images in my application and want to send one of the images through mail. my code looks like Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.setType("image/*"); sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Picture"); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(lstPhotos.get(newPosition).getPhotoURL())); myActivity.startActivity(Intent.createChooser(sendIntent, "Email:")); But in the above code i have a problem since i cannot get the image URI from

Android: ACTION_SEND_MULTIPLE with com.android.email

一曲冷凌霜 提交于 2020-01-03 21:03:19
问题 I'm trying to send multiple attachments in an Intent to the Email app (not the Gmail app). I'm using: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); emailIntent.setType("plain/text"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[] { "sample@email.com" }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"This is an email"); emailIntent.putExtra(Intent.EXTRA_TEXT, "This is the body"); File f1 = null; File f2 = null; try { f1 = new

Launch an activity of an application from a different application on Android

ⅰ亾dé卋堺 提交于 2020-01-03 19:42:14
问题 I need to launch an activity (not the main activity) of an application from an application I have made. The activity I want to launch is proprietary, hence, I cannot make any changes to its code(or manifest). For example: I want to launch somebody's Facebook profile from my own application. A normal intent to facebook from my app would open the 'newsfeed'(which I don't want). I want to know how to access any other activity. Thanks in advance! The little code I have: String PACKAGE="com

Getting arguments from a bundle

旧街凉风 提交于 2020-01-03 19:18:10
问题 I'm trying to pass arguments from my Activity to a Fragment and I'm using this code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); String message = getIntent().getStringExtra(Intent.EXTRA_TEXT); DetailActivityFragment fragment = new DetailActivityFragment(); Bundle bundle = new Bundle(); bundle.putString(INTENT_EXTRA, message); fragment.setArguments(bundle); } I'm getting the value of the message

Getting arguments from a bundle

六眼飞鱼酱① 提交于 2020-01-03 19:15:17
问题 I'm trying to pass arguments from my Activity to a Fragment and I'm using this code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); String message = getIntent().getStringExtra(Intent.EXTRA_TEXT); DetailActivityFragment fragment = new DetailActivityFragment(); Bundle bundle = new Bundle(); bundle.putString(INTENT_EXTRA, message); fragment.setArguments(bundle); } I'm getting the value of the message