I want to open a PDF from the assets folder from my activity button action and I used the below codes but nothing happens.
 public class AssetsProvider extends ContentProvider {
    @Override
    public AssetFileDescriptor openAssetFile(Uri uri, String mode ) throws FileNotFoundException
    {
    AssetManager am = getContext( ).getAssets( );
    String file_name = uri.getPath().substring(1, uri.getPath().length());
    if( file_name == null )
            throw new FileNotFoundException( );
    AssetFileDescriptor afd = null;
    try
    {
        afd = am.openFd( file_name );
    }
    catch(IOException e)
    {
        e.printStackTrace( );
    }
   return afd;
}
@Override
    public String getType( Uri p1 )
    {
        return null;
    }
 @Override
    public int delete( Uri p1, String p2, String[] p3 )
    {
        return 0;
    }
 @Override
    public Cursor query( Uri p1, String[] p2, String p3, String[] p4, String p5 )
    {
        return null;
    }
@Override
    public Cursor query( Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder, CancellationSignal cancellationSignal )
    {
        return super.query( uri, projection, selection, selectionArgs, sortOrder, cancellationSignal );
    }
    @Override
    public Uri insert( Uri p1, ContentValues p2 )
    {
        return null;
    }
  @Override
    public boolean onCreate( )
    {
        return false;
    }
 @Override
    public int update( Uri p1, ContentValues p2, String p3, String[] p4 )
    {
        return 0;
    }
}
And it's triggered from a activity button action as follows and the pdf file path url passed from here:
btn_help.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
    try {
                               new  AssetsProvider().openAssetFile(Uri.parse("file:///android_asset/Guide.pdf"),null);
                            } catch (FileNotFoundException e) {
                                e.printStackTrace();
                            }
                        }
                    });
Declared the provider class on Manifest like below :
 <provider
            android:name="com.star.form.helper.AssetsProvider"
            android:authorities="om.star.form.eform.helper"
            android:grantUriPermissions="true"
            android:exported="true" />
Please guide me on this.