Sharing intent file path to file manager to open that pathandroid:onclick method doesn't workjava.lang.IllegalStateException Not sure it is it with the data type?App keeps crashing (Android official tutorial)Parse String to double from EditText causes runtime errorMy application is closing,when i click the buttonApp is crashing when clicking buttonandroid button causing crashApp crashing in the part of Grid layout declarationApp crashes everytime i press result button

What is the meaning of "it" in "as luck would have it"?

Why did the Apple IIe make a hideous noise if you inserted the disk upside down?

Drawing a sigmoid function and its derivative in tikz

Is this house-rule removing the increased effect of cantrips at higher character levels balanced?

Is it OK to say "The situation is pregnant with a crisis"?

How do I debug a dependency package? If I have its source code

I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again

A* pathfinding algorithm too slow

How do I present a future free of gender stereotypes without being jarring or overpowering the narrative?

How soon after takeoff can you recline your airplane seat?

Calculus, water poured into a cone: Why is the derivative non-linear?

What verb goes with "coup"?

My mom helped me cosign a car and now she wants to take it

Robots in a spaceship

A quine of sorts

What happens if a caster is surprised while casting a spell with a long casting time?

What could a Medieval society do with excess animal blood?

Rear derailleur got caught in the spokes, what could be a root cause

What is the lowest possible AC?

Why didn't Avengers simply jump 5 years back?

What does that Pokemon Trainer mean by saying I am a SHELLOS?

Odd PCB Layout for Voltage Regulator

Why are symbols not written in words?

Why are examinees often not allowed to leave during the start and end of an exam?



Sharing intent file path to file manager to open that path


android:onclick method doesn't workjava.lang.IllegalStateException Not sure it is it with the data type?App keeps crashing (Android official tutorial)Parse String to double from EditText causes runtime errorMy application is closing,when i click the buttonApp is crashing when clicking buttonandroid button causing crashApp crashing in the part of Grid layout declarationApp crashes everytime i press result button













1















I was trying to open file manager by passing the path of the folder that i specifically want to open.



But the app keeps crashing. below i hava attached the code, manifest file and the crash log.



If you are able to solve the problem do comment your suggestions.



CODE:




Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Uri fileUri = FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID+".fileprovider",folder);

intent.setDataAndType(FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID+".fileprovider",folder),"file/*");
intent.setFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
startActivityForResult(intent);


Manifest file:



<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.fileprovideropenfile">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$applicationId.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths">
</meta-data>
</provider>
</application>

</manifest>


XML file:



<external-path name="file" path="com.example.fileprovideropenfile/"/>


CRASH:



E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.fileprovideropenfile, PID: 9483
java.lang.IllegalStateException: Could not execute method for android:onClick
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390)
at android.view.View.performClick(View.java:6294)
at android.view.View$PerformClick.run(View.java:24770)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385)
at android.view.View.performClick(View.java:6294) 
at android.view.View$PerformClick.run(View.java:24770) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
Caused by: java.lang.StringIndexOutOfBoundsException: length=52; index=53
at java.lang.String.substring(String.java:1939)
at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:748)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:418)
at com.example.fileprovideropenfile.MainActivity.openTheFile(MainActivity.java:40)
at java.lang.reflect.Method.invoke(Native Method) 
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) 
at android.view.View.performClick(View.java:6294) 
at android.view.View$PerformClick.run(View.java:24770) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)


Your comments are much welcomed. Please help me solving this problem.










share|improve this question


























    1















    I was trying to open file manager by passing the path of the folder that i specifically want to open.



    But the app keeps crashing. below i hava attached the code, manifest file and the crash log.



    If you are able to solve the problem do comment your suggestions.



    CODE:




    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    Uri fileUri = FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID+".fileprovider",folder);

    intent.setDataAndType(FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID+".fileprovider",folder),"file/*");
    intent.setFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
    startActivityForResult(intent);


    Manifest file:



    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.fileprovideropenfile">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


    <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:ignore="GoogleAppIndexingWarning">

    <activity android:name=".MainActivity">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    <provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="$applicationId.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
    android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/file_paths">
    </meta-data>
    </provider>
    </application>

    </manifest>


    XML file:



    <external-path name="file" path="com.example.fileprovideropenfile/"/>


    CRASH:



    E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.fileprovideropenfile, PID: 9483
    java.lang.IllegalStateException: Could not execute method for android:onClick
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390)
    at android.view.View.performClick(View.java:6294)
    at android.view.View$PerformClick.run(View.java:24770)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
    Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385)
    at android.view.View.performClick(View.java:6294) 
    at android.view.View$PerformClick.run(View.java:24770) 
    at android.os.Handler.handleCallback(Handler.java:790) 
    at android.os.Handler.dispatchMessage(Handler.java:99) 
    at android.os.Looper.loop(Looper.java:164) 
    at android.app.ActivityThread.main(ActivityThread.java:6494) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
    Caused by: java.lang.StringIndexOutOfBoundsException: length=52; index=53
    at java.lang.String.substring(String.java:1939)
    at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:748)
    at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:418)
    at com.example.fileprovideropenfile.MainActivity.openTheFile(MainActivity.java:40)
    at java.lang.reflect.Method.invoke(Native Method) 
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) 
    at android.view.View.performClick(View.java:6294) 
    at android.view.View$PerformClick.run(View.java:24770) 
    at android.os.Handler.handleCallback(Handler.java:790) 
    at android.os.Handler.dispatchMessage(Handler.java:99) 
    at android.os.Looper.loop(Looper.java:164) 
    at android.app.ActivityThread.main(ActivityThread.java:6494) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)


    Your comments are much welcomed. Please help me solving this problem.










    share|improve this question
























      1












      1








      1








      I was trying to open file manager by passing the path of the folder that i specifically want to open.



      But the app keeps crashing. below i hava attached the code, manifest file and the crash log.



      If you are able to solve the problem do comment your suggestions.



      CODE:




      Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
      Uri fileUri = FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID+".fileprovider",folder);

      intent.setDataAndType(FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID+".fileprovider",folder),"file/*");
      intent.setFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
      startActivityForResult(intent);


      Manifest file:



      <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      package="com.example.fileprovideropenfile">

      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


      <application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"
      tools:ignore="GoogleAppIndexingWarning">

      <activity android:name=".MainActivity">
      <intent-filter>
      <action android:name="android.intent.action.MAIN" />

      <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      </activity>
      <provider
      android:name="android.support.v4.content.FileProvider"
      android:authorities="$applicationId.fileprovider"
      android:exported="false"
      android:grantUriPermissions="true">
      <meta-data
      android:name="android.support.FILE_PROVIDER_PATHS"
      android:resource="@xml/file_paths">
      </meta-data>
      </provider>
      </application>

      </manifest>


      XML file:



      <external-path name="file" path="com.example.fileprovideropenfile/"/>


      CRASH:



      E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.fileprovideropenfile, PID: 9483
      java.lang.IllegalStateException: Could not execute method for android:onClick
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390)
      at android.view.View.performClick(View.java:6294)
      at android.view.View$PerformClick.run(View.java:24770)
      at android.os.Handler.handleCallback(Handler.java:790)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:164)
      at android.app.ActivityThread.main(ActivityThread.java:6494)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
      Caused by: java.lang.reflect.InvocationTargetException
      at java.lang.reflect.Method.invoke(Native Method)
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385)
      at android.view.View.performClick(View.java:6294) 
      at android.view.View$PerformClick.run(View.java:24770) 
      at android.os.Handler.handleCallback(Handler.java:790) 
      at android.os.Handler.dispatchMessage(Handler.java:99) 
      at android.os.Looper.loop(Looper.java:164) 
      at android.app.ActivityThread.main(ActivityThread.java:6494) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
      Caused by: java.lang.StringIndexOutOfBoundsException: length=52; index=53
      at java.lang.String.substring(String.java:1939)
      at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:748)
      at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:418)
      at com.example.fileprovideropenfile.MainActivity.openTheFile(MainActivity.java:40)
      at java.lang.reflect.Method.invoke(Native Method) 
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) 
      at android.view.View.performClick(View.java:6294) 
      at android.view.View$PerformClick.run(View.java:24770) 
      at android.os.Handler.handleCallback(Handler.java:790) 
      at android.os.Handler.dispatchMessage(Handler.java:99) 
      at android.os.Looper.loop(Looper.java:164) 
      at android.app.ActivityThread.main(ActivityThread.java:6494) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)


      Your comments are much welcomed. Please help me solving this problem.










      share|improve this question














      I was trying to open file manager by passing the path of the folder that i specifically want to open.



      But the app keeps crashing. below i hava attached the code, manifest file and the crash log.



      If you are able to solve the problem do comment your suggestions.



      CODE:




      Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
      Uri fileUri = FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID+".fileprovider",folder);

      intent.setDataAndType(FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID+".fileprovider",folder),"file/*");
      intent.setFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
      startActivityForResult(intent);


      Manifest file:



      <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      package="com.example.fileprovideropenfile">

      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


      <application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"
      tools:ignore="GoogleAppIndexingWarning">

      <activity android:name=".MainActivity">
      <intent-filter>
      <action android:name="android.intent.action.MAIN" />

      <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      </activity>
      <provider
      android:name="android.support.v4.content.FileProvider"
      android:authorities="$applicationId.fileprovider"
      android:exported="false"
      android:grantUriPermissions="true">
      <meta-data
      android:name="android.support.FILE_PROVIDER_PATHS"
      android:resource="@xml/file_paths">
      </meta-data>
      </provider>
      </application>

      </manifest>


      XML file:



      <external-path name="file" path="com.example.fileprovideropenfile/"/>


      CRASH:



      E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.fileprovideropenfile, PID: 9483
      java.lang.IllegalStateException: Could not execute method for android:onClick
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390)
      at android.view.View.performClick(View.java:6294)
      at android.view.View$PerformClick.run(View.java:24770)
      at android.os.Handler.handleCallback(Handler.java:790)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:164)
      at android.app.ActivityThread.main(ActivityThread.java:6494)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
      Caused by: java.lang.reflect.InvocationTargetException
      at java.lang.reflect.Method.invoke(Native Method)
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385)
      at android.view.View.performClick(View.java:6294) 
      at android.view.View$PerformClick.run(View.java:24770) 
      at android.os.Handler.handleCallback(Handler.java:790) 
      at android.os.Handler.dispatchMessage(Handler.java:99) 
      at android.os.Looper.loop(Looper.java:164) 
      at android.app.ActivityThread.main(ActivityThread.java:6494) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
      Caused by: java.lang.StringIndexOutOfBoundsException: length=52; index=53
      at java.lang.String.substring(String.java:1939)
      at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:748)
      at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:418)
      at com.example.fileprovideropenfile.MainActivity.openTheFile(MainActivity.java:40)
      at java.lang.reflect.Method.invoke(Native Method) 
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) 
      at android.view.View.performClick(View.java:6294) 
      at android.view.View$PerformClick.run(View.java:24770) 
      at android.os.Handler.handleCallback(Handler.java:790) 
      at android.os.Handler.dispatchMessage(Handler.java:99) 
      at android.os.Looper.loop(Looper.java:164) 
      at android.app.ActivityThread.main(ActivityThread.java:6494) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)


      Your comments are much welcomed. Please help me solving this problem.







      java android android-fileprovider






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 16:25









      Karthick KumarKarthick Kumar

      62 bronze badges




      62 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/myFolder/"); intent.setDataAndType(uri,"*/*"); startActivity(Intent.createChooser(intent, "Open folder")); 


          No changes in android manifest file. Please use above code only.






          share|improve this answer























          • ur approach only opens the file manager, but what i want is to open the folder that in specific path.

            – Karthick Kumar
            Apr 1 at 16:19











          • If you are mentioning your specific path it will open that particular path only.

            – Magudesh
            Apr 2 at 4:38










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55342306%2fsharing-intent-file-path-to-file-manager-to-open-that-path%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/myFolder/"); intent.setDataAndType(uri,"*/*"); startActivity(Intent.createChooser(intent, "Open folder")); 


          No changes in android manifest file. Please use above code only.






          share|improve this answer























          • ur approach only opens the file manager, but what i want is to open the folder that in specific path.

            – Karthick Kumar
            Apr 1 at 16:19











          • If you are mentioning your specific path it will open that particular path only.

            – Magudesh
            Apr 2 at 4:38















          0














          Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/myFolder/"); intent.setDataAndType(uri,"*/*"); startActivity(Intent.createChooser(intent, "Open folder")); 


          No changes in android manifest file. Please use above code only.






          share|improve this answer























          • ur approach only opens the file manager, but what i want is to open the folder that in specific path.

            – Karthick Kumar
            Apr 1 at 16:19











          • If you are mentioning your specific path it will open that particular path only.

            – Magudesh
            Apr 2 at 4:38













          0












          0








          0







          Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/myFolder/"); intent.setDataAndType(uri,"*/*"); startActivity(Intent.createChooser(intent, "Open folder")); 


          No changes in android manifest file. Please use above code only.






          share|improve this answer













          Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/myFolder/"); intent.setDataAndType(uri,"*/*"); startActivity(Intent.createChooser(intent, "Open folder")); 


          No changes in android manifest file. Please use above code only.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 25 at 17:13









          MagudeshMagudesh

          1531 silver badge8 bronze badges




          1531 silver badge8 bronze badges












          • ur approach only opens the file manager, but what i want is to open the folder that in specific path.

            – Karthick Kumar
            Apr 1 at 16:19











          • If you are mentioning your specific path it will open that particular path only.

            – Magudesh
            Apr 2 at 4:38

















          • ur approach only opens the file manager, but what i want is to open the folder that in specific path.

            – Karthick Kumar
            Apr 1 at 16:19











          • If you are mentioning your specific path it will open that particular path only.

            – Magudesh
            Apr 2 at 4:38
















          ur approach only opens the file manager, but what i want is to open the folder that in specific path.

          – Karthick Kumar
          Apr 1 at 16:19





          ur approach only opens the file manager, but what i want is to open the folder that in specific path.

          – Karthick Kumar
          Apr 1 at 16:19













          If you are mentioning your specific path it will open that particular path only.

          – Magudesh
          Apr 2 at 4:38





          If you are mentioning your specific path it will open that particular path only.

          – Magudesh
          Apr 2 at 4:38






          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55342306%2fsharing-intent-file-path-to-file-manager-to-open-that-path%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript