android intent filter for custom file extension

前端 未结 1 2070
不知归路
不知归路 2020-12-20 03:27

I am trying to make an android app to open files with extension .abc and this is my application section from android manifest xml



        
1条回答
  •  生来不讨喜
    2020-12-20 03:50

    First of all, the first intent-filter in your example uses MIME type image/jpeg. Is jpeg your .abc extension?

    I think there may be three reasons why this does not work:

    1. You need to add more MIME types. Try adding the following:

      
          
          
          
          
      
      
      
          
          
          
          
      
      

      And, if your .abc format is a text format:

      
          
          
          
          
      
      
    2. You have registered the file scheme. You might also need the content scheme:

      
          
          
          
          
          
          
          
      
      
    3. Rumor has it that pathPattern with a dot only matches files containing a single dot. In your example, this would mean that your app would be associated with One.abc but not with Two.Dots.abc. Try adding more pathPatterns .*\\..*\\.abc, .*\\..*\\..*\\.abc etc.:

      
          
          
          
          
          
          
          
      
      

    0 讨论(0)
提交回复
热议问题