android-intent

Custom actions using implicit intents between applications

折月煮酒 提交于 2019-12-23 07:59:52
问题 I have been trying to get two activities in two separate applications to communicate using a custom action and an implicit intent. The first application (server), has the following manifest: <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"> <activity android:name="edu.example.sharing.manager.SecureFileShare" android:label="@string/title_activity_secure_file_share" android:exported="true"> <intent-filter> <action android:name=

Android: PendingIntent from Notification doesn't trigger the onCreate() if bringing Activity back on Screen

…衆ロ難τιáo~ 提交于 2019-12-23 07:59:12
问题 guess I'm having some misunderstandigs with the Intent Flags.. What I'm trying to do is, I'm having a radio streaming applications, which has two Activities (PlayerApplication and SettingsScreen). I have a Service.class for Streaming which runs in the background, which holds a Notification as well (you can stop/start playback in the notification-overlay menu and the PlayerApplication). If the User clicks on the Notification, the PlayerApplicationActivity should be com back to screen.

Android ACTION_MEDIA_SCANNER_SCAN_FILE not showing image until reboot?

做~自己de王妃 提交于 2019-12-23 07:50:03
问题 I am currently developing an Android Application where users take pictures which are stored in External Memory on the device then I am trying to also get the Gallery to scan the file to add the new media to the Gallery however this does not seem to update until the device reboots. The code I am using is as follows: Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); File f = new File(mCurrentPhotoPath); Log.v("INFO", mCurrentPhotoPath.toString()); Uri contentUri = Uri

Android Intent :-Use Intent to pass class objects from Activities [duplicate]

假如想象 提交于 2019-12-23 07:46:26
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to send an object from one Android Activity to another using Intents? I want to pass a class object from an Activity to other when one Activity calls to the other. I am trying to use Intent.putExtra(name, value) to make that but then I don´t have Intent.getExtra(name) method. There are a lot of methods like getStringExtra(name) , getDataExtra(name) and so on but what I put in the value of putExtra is a class

Permission required when using Intent to call phone?

半世苍凉 提交于 2019-12-23 07:46:06
问题 In one of my apps I'm using the following code to issue a phone call: Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(...)); startActivity(intent); The docs say I do need the following Manifest permission to do so: <uses-permission android:name="android.permission.CALL_PHONE" /> Is this really required? I do not understand the difference between a phone and a camera feature. When using a phone intent I do need a permission but I don't need permission for a camera intent: Intent

Android “java.lang.RuntimeException: Parcelable encounteredClassNotFoundException reading a Serializable object”

夙愿已清 提交于 2019-12-23 07:37:27
问题 I have an Android application in which I add one more enum: public enum RootNavigationOption { HOME(R.string.home, R.drawable.ic_home), SETTINGS(R.string.settings, R.drawable.ic_settings), LOGOUT( R.string.logout_label, R.drawable.ic_logout); private int navigationOptionLabelResId; private int navigationOptionImageResId; private RootNavigationOption(int navigationOptionLabelResId, int navigationOptionImageResId) { this.navigationOptionLabelResId = navigationOptionLabelResId; this

Camera or Gallery intent destroys old activity on some devices

送分小仙女□ 提交于 2019-12-23 07:29:19
问题 I am working on app which uses WebView to display its content. However, it needs to open camera or gallery in order to choose picture: Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, 1); Intent galleryIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(galleryIntent, 2); It's working fine on most devices, but on HTC One and few others both intents

Add my browser in the default browser selection list in android?

隐身守侯 提交于 2019-12-23 07:25:49
问题 Following the suggestions from How to add my browser in the default browser selection list in android?. I have specified my Intent in the manifest file: <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="http"/> <data android:scheme="https"/> </intent-filter> I have also added the permission: <uses-permission android:name="android.permission.INTERNET"></uses-permission> But still my browser is

Is it safe to reuse an intent?

牧云@^-^@ 提交于 2019-12-23 06:56:40
问题 The Android docs define an Intent as "a bundle of information containing an abstract description of an operation to perform". This suggests that you should be able to reuse a single Intent object multiple times if needed, but I haven't seen any examples showing this is the case/ is safe to do. Is there any reason to NOT do the following: private final Intent enableBluetoothIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); ... protected void onCreate(Bundle savedInstanceState)

How to open a file in Android via an Intent

前提是你 提交于 2019-12-23 06:56:09
问题 how can I open a file that has been previously stored in the "privat" filesystem? The file is being downloaded by a webservice and should be stored on local fs. I got a "strange" error when trying to open the file via an Intent (Action_View). Although the file is present in the filesystem (saw the file in the file explorer in emulator/eclipse) it won't be shown in the calling galery activity that is launched. Instead of the picture the galery shows a black screen with not content in there