android-intent

comparing android intent objects

混江龙づ霸主 提交于 2019-12-24 04:12:45
问题 I have 2 android intent objects that can be persisted as URLs and then rehydrated back into intent objects. I'm wondering what is the most effective way to compare any 2 intent objects to ensure that they end up resolving to the same activity with the same parameters etc. Using intent.filterEquals does this, but it does not include the extras. Currently my code for the equals method looks like this: Intent a = Intent.parseUri(this.intentUrl, Intent.URI_INTENT_SCHEME); Intent b = Intent

Intent to Hidden Application on Android

早过忘川 提交于 2019-12-24 03:33:05
问题 I have two application. I want to intent to the second one from the first one. But the second application must be launched from first one. So i have to hide the second one's icon. When i delete the category tag from the second one's manifest.xml, icon is disappearing. But this time i can't launch the second app from the first app with intent. This is how i tried to intent: Intent openvideo = getPackageManager().getLaunchIntentForPackage("air.deneme"); startActivity(openvideo); How can i

If my app was started via ACTION_VIEW, how do I retrieve the attached data?

不想你离开。 提交于 2019-12-24 03:25:45
问题 I've made my app handle ACTION_VIEW intents for a certain data type, which it does fine. I can't seem to work out how to actually detect whether my app has been launched in this way though, and how to get at the attached data. Can someone point me in the right direction? Here's an excerpt from my manifest, if it helps. <activity android:name=".MyApp" android:label="@string/app_name" android:screenOrientation="portrait" > ... <intent-filter> <action android:name="android.intent.action.VIEW"/>

geo: Intent with label (Android)

不羁岁月 提交于 2019-12-24 03:22:24
问题 Is there a working way (i heard that as of update 7.0 there were some changes) to display a marker with a position given by latitude/longitude with a label? geo:?q=latitude, longitude (Label) does not work... 回答1: Show point on google map via an intent. String uri = "geo:"+ latitude + "," + longitude; startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri))); You can also choose to place a point like so: String uri = "geo:"+ latitude + "," + longitude + "?q=my+street

Android - get file path of a selected pdf, doc, ppt or xls in my app

耗尽温柔 提交于 2019-12-24 03:12:17
问题 I am developing an android application. My AIM: If the user open the pdf, doc, ppt or xls files in any folder inside the SDCard (or) dropbox (or) email etc..., they must navigate into my app(In my app, I will do some process based on the files they selected). What I did: If the user click on the PDF file, I can get the filepath and they are navigate into my app. For this I have done the following code. Code snippet: In the AndroidManifest.xml, I have added the following code: <activity

Unable to attach multiple files to an email in Android

萝らか妹 提交于 2019-12-24 03:06:25
问题 I want to attach multiple files to an email. First I am preparing list of Uri 's. void prepareListOfUri() { listOfUri = new ArrayList<Uri>(); File fileTemp = new File(android.os.Environment.getExternalStorageDirectory(), "BuyNowImages"); fileTemp.mkdirs(); for (int i = 0; i < listOfImageView.size(); i++) { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); Drawable drawable = listOfImageView.get(i).getDrawable(); Bitmap bitmapPicked = ((BitmapDrawable) drawable).getBitmap();

ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///mnt/sdcard/testdata5.pdf

北慕城南 提交于 2019-12-24 02:45:12
问题 I have a requirement to display pdf file from SD card. This pdf file is created after a network operation. I'm getting ActivityNotFoundException when trying to open pdf through activity.startActivity(intent); . Below is code folder_list_details.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:layout_height="wrap_content" android:layout

Call TextToSpeech Activity Without Any UI Display

二次信任 提交于 2019-12-24 02:42:52
问题 What is the recommended way to call TextToSpeech without invoking any UI change? The examples given are all bound to Activities, and the default behavior for an activity is to display its own UI. I'm trying to call a TextToSpeechActivity via my main activity via an Intent. I don't want the UI to change at all. I want the TextToSpeech to sound without anything in the UI changing. Here's what I have so far. public class MyActivity extends Activity { public void onClick(View v) { Intent intent =

Sensibly setting default app (through Chooser, Preference, etc.) for ACTION_SEND text

試著忘記壹切 提交于 2019-12-24 02:37:26
问题 My application will be (optionally) sending social media updates when an action is performed. I want to do this by using the user's installed social media apps. I don't want to restrict the user to any particular set of apps, so anything that can respond to an ACTION_SEND Intent with a type of text/plain will be fine. However, I don't want the user to have to choose every time -- typically, they'll by using the same app every time, i.e. once they've picked TweetCaster/Facebook/whatever, they

How to get Date extra from an intent?

爱⌒轻易说出口 提交于 2019-12-24 02:21:03
问题 I am packing an intent and one of the Extras I add is a date object, like this: intent.putExtra(DATE_EXTRA, t.getDate()); Later, when I reading the extras, I try to get the Date like this: this.date = new Date(intent.getExtras().getString(DATE_EXTRA)); However, this returns an error about the String being empty. I don't think the above is the right way to do it, because I am not looking for a string, but I have not been able to find an intent.getDateExtra() method anywhere. What do I do? I