Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8020105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:35:38+00:00 2026-06-04T21:35:38+00:00

I have been trying to write a program for transferring a file which the

  • 0

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> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:35:39+00:00Added an answer on June 4, 2026 at 9:35 pm

    Try this code::Refer this LINK

    String mimeType = fileAction.getMimeType(rowHolder.get(position).getLabel());
    Intent intent = new Intent();  
    intent.setAction(android.content.Intent.ACTION_SEND);  
    intent.setType(mimeType);
    Uri pathUri = Uri.parse("file://" + currentPath + rowHolder.get(position).getLabel());
    intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(pathUri ) );  
    startActivity(intent);
    

    Updated::

    File file = new File(Path.toString());  
    intent.setDataAndType(Uri.fromFile(file), mimeType);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to write a powershell program that checks to see if
I have been trying to write some code that asks the user for several
I have been trying to write a C program which generates all possible permutations
I have been trying to write a style sheet for the following documents which
I have been trying to write a regex that will remove whitespace following a
I have been trying to write a custom .screenrc file TEST as follows startup_message
Hii , I have been trying to write a program... We have a structure
I've been trying to write a program in R that implements Newton's method. I've
I've been trying to write a program for the last several hours that does
I have been trying to write a program to convert my father's old PTS.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.