Tag: android-intent

MEDIA_MOUNTED broadcast not being received

I’m baffled. I’m trying to configure my app to respond to the SD card becoming available / going offline, but my broadcast receiver never gets called! I can see the event being broadcasted, and other apps responding: 08-21 23:43:04.405: DEBUG/Ringer(275): — intent.getAction() =android.intent.action.MEDIA_MOUNTED And my manifest has the receiver declared: <receiver android:name=”.Test” android:enabled=”true”> <intent-filter> <action […]

Attachment is not coming in mail programmatically

I am attaching a TEXT file to Email with code : Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(“mailto”, “abc@gmail.com”, null)); emailIntent.putExtra(Intent.EXTRA_SUBJECT, “Report”); emailIntent.putExtra(Intent.EXTRA_TEXT, prepareBodyMail()); File root = Environment.getExternalStorageDirectory(); File file = new File(root, “/MyFolder/report.txt”); Uri uri = Uri.fromFile(file); emailIntent.putExtra(Intent.EXTRA_STREAM, uri); startActivity(Intent.createChooser(emailIntent, “Pick an Email provider”)); This code works perfectly with Gmail, Email and other apps But […]

Register as music player and play song

I’m creating a music player app and I want to register the app as a music player. So that when a user clicks on any song to play, my app should be suggested as one of the music players. I followed this guide . After I added the necessary code in manifest.xml, it only shows […]

onNewIntent is not called

I have very strange situation. Having one app, I decided to create another one from the code of first one. I copied .xml files, copied .java files so that everything is OK. But there’s one HUGE problem: my onNewIntent(Intent intent) method is called in first project, but it’s not called in the second project (the […]

Android SMS Message delivery report intent

Android isn’t firing the delivery intent when sending a text message. I’m testing this on Android 2.2 on the HTC EVO 4G. This is the current code. I’m seeing “SMS sent intent received.” in the logs, but not “SMS delivered intent received.”. // Constants String SENT_ACTION = “SMS_SENT_ACTION”; String DELIVERED_ACTION = “SMS_DELIVERED_ACTION”; String CELL_NUMBER = […]

how to filter specific Activities to be tested by monkey using android.intent.category?

I’m trying to stress test my android application using the monkey exercise tool. By default the tool will exercise activities having category Intent.CATEGORY_LAUNCHER or Intent.CATEGORY_MONKEY according to the doc. package=”my.android” <activity android:name=”.activities.MyApp”> <intent-filter> <action android:name=”android.intent.action.MAIN”/> <category android:name=”android.intent.category.LAUNCHER”/> </intent-filter> </activity> <activity android:name=”.activities.MyScreen”> <intent-filter> <category android:name=”android.intent.category.MONKEY”/> </intent-filter> </activity> <activity android:name=”.activities.MySettings”/> I do not want MySettings to be […]

Handle download intents in my app

My webview app already handles external URL’s fine (opens links from external apps like viber, browsers, etc) like this- (i got this code from here) // get URL from browsable intent filter TextView uri = (TextView) findViewById(R.id.urlField); // get the url url = getIntent().getDataString(); Uri data = getIntent().getData(); if (data == null) { uri.setText(“”); } […]

Capture Image while Device is Locked with Password

I want to implement a functionality to capture image through front camera when someone tries to unlock my device and enter incorrect password 3 times. I checked that it is possible in Android and some applications are also available in Market. I have done some work to achieve this but I am getting a black […]

New KitKat URIs dont respond to Intent.ACTION_VIEW

Since KitKat has changed the URIs from pickers to likes of content://com.android.providers.media.documents/document/image:3951 then none of my ACTION_VIEW intents work anymore. When for example user picks an image, I use public static void openImage(Fragment f, Uri uri) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri, “image/*”); f.startActivity(intent); } and Android Gallery and Google+ Photos come up, but […]

LibGDX inside Android Activity

I’m in the middle of developing a small app for Android using the Android UI and activities for the most part of the interaction, however one key aspect requires the use of LibGDX (using 3D models and physics). I want to be able to click a button in my app (my “Activate” class) which will […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.