How to Access File Manager System Using Explorer or Browser in Android App Using Android Studio and Java

Using this article, We are going to discuss the concept “How to Access File Manager System Using Explorer or Browser in Android App Using Android Studio and Java will helpful for you. Let’s move on to this article.

Access File Manager System Using Explorer or Browser in Android App Using Android Studio and Java

Access File Manager System Using Explorer or Browser in Android App Using Android Studio and Java

package com.example.myfileaccessapp;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
private TextView textView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
}

public void BrowseButton(View view){
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType(“*/*”);
startActivityForResult(intent, 1);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
textView.setText(data.getDataString());
Toast.makeText(this.getApplicationContext(), data.getDataString(),Toast.LENGTH_LONG).show();
super.onActivityResult(requestCode, resultCode, data);
}
}
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns:android=”http://schemas.android.com/apk/res/android”
package=”com.example.myfileaccessapp”>

<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”>
<activity android:name=”.MainActivity”>
<intent-filter>
<action android:name=”android.intent.action.MAIN” />

<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
</activity>
</application>

</manifest>

Final Words

We hope this article Access File Manager System Using Explorer or Browser in Android App Using Android Studio and Java will helpful for you. If you face any issues in this execution then ask us via the comment section. Share this article with other Android learners to encourage us.

Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment