How to Share Image + Text together using ACTION_SEND in android?

You can share plain text with the following code String shareBody = “Here is the share content body”; Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); sharingIntent.setType(“text/plain”); sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, “Subject Here”); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody); startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_using))); So your full code (your image + text) becomes private Uri imageUri; private Intent intent; imageUri = Uri.parse(“android.resource://” + getPackageName() + “/drawable/” + “ic_launcher”); … Read more

Unable to start Service Intent

For anyone else coming across this thread I had this issue and was pulling my hair out. I had the service declaration OUTSIDE of the ‘< application>’ end tag DUH! RIGHT: <manifest xmlns:android=”http://schemas.android.com/apk/res/android” …> … <application android:icon=”@drawable/icon” android:label=”@string/app_name”> <activity …> … </activity> <service android:name=”.Service”/> <receiver android:name=”.Receiver”> <intent-filter> … </intent-filter> </receiver> </application> <uses-permission android:name=”…” /> WRONG … Read more

Android app enable NFC only for one Activity

If you want to diable processing of NFC discovery events (NDEF_DISCOVERED, TECH_DISCOVERED, TAG_DISCOVERED) while a certain activity is in the foreground, you would register that activity for the foreground dispatch system. That activity can then ignore these events (which it would receive in its onNewIntent() method. This will prevent NFC discovery events to be delivered … Read more

Launching custom Android application from Android browser / Chrome

You need to set it up like this : <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.DEFAULT” /> <category android:name=”android.intent.category.BROWSABLE” /> <data android:host=”example.com” android:pathPrefix=”/someresource/” android:scheme=”http” /> <data android:host=”www.example.com” android:pathPrefix=”/someresource/” android:scheme=”http” /> </intent-filter> Notice that in your case, you would need to use android:pathPrefix instead of android:path.