I have been trying to write a program for transferring a file which the user selects from a ListView that i provide to the user. Once the user selects a file which he intends to transfer (“I achieved that using onLongClickListener“), this particular block of code is triggered:
String mimeType = fileAction.getMimeType(rowHolder.get(position).getLabel());
Intent playFile = new Intent();
playFile.setAction(android.content.Intent.ACTION_SEND);
Uri pathUri = Uri.parse("file://" + currentPath + rowHolder.get(position).getLabel());
playFile.setDataAndType(pathUri, mimeType);
startActivity(playFile);
The trouble is that when I select the Bluetooth option from the list of options of applications which can handle this type of Intent [“This part is automatic“] nothing happens. This problem is only occurring when I am clicking on Bluetooth. All the other options like GMail, Bump, etc are working perfectly. Any help/Guidance would be appreciated. Thanks in Advance. Also, this is my Manifest File in case it seems that the sets of permissions is less than required. AndroidManifest File:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sample.test"
android:versionCode="2"
android:versionName="1.1">
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:debuggable="false"
android:theme="@android:style/Theme.NoTitleBar" >
<activity android:name=".Main"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Preferences"
android:label="@string/preferences" >
</activity>
<activity
android:name=".SearchFileSystem"
android:label="@string/search" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
</application>
</manifest>
Try this code::Refer this LINK
Updated::