Now it is clear, thank you for the explanation.
On 23 июл, 13:47, Dianne Hackborn <hack...@android.com> wrote:
> As I said at the very start of this, Android doesn't know anything about
> file extensions. There are some applications (like the browser) that have
> some tables mapping common file extensions to MIME types, but there is no
> support at all for file extensions in the platform itself.
>
>
>
> On Thu, Jul 23, 2009 at 2:41 AM, BouHu <petrov....@gmail.com> wrote:
>
> > Exactly, but file manager can't fill "type" information of the intent
> > because it has no information about custom MIME type and there is no
> > way to get it by file extension or something like that. e.g. I want to
> > register MIME type "mytype" for the files with extension of
> > "*.mytype", so i create an activity with intent filter and specify
> > Mime type for it as "misc/mytype". Now, since i know this type, i can
> > open an activity with type of "misc/mytype" by fillinf type of an
> > intent appropriately . File manager can't find MIME for file extension
> > "mytype", or, at least, i couldn't find the way do it. The only way to
> > bind MIME with file extension i've found is MymeTypeMap, but all the
> > values there are hardcoded during creation. So the question is how to
> > broadcast new MIME type for the new file extension so that file
> > managers could fill intent properly.
>
> > Thanks in advance.
>
> > On 23 июл, 12:58, Dianne Hackborn <hack...@android.com> wrote:
> > > It's the exact same thing. startActivity() is called with a VIEW action
> > > whose MIME type is the type of data to be viewed.
>
> > > On Wed, Jul 22, 2009 at 11:44 PM, BouHu <petrov....@gmail.com> wrote:
>
> > > > Thanks for reply, but Notepad list activity handles its own types,
> > > > while the thing i'm interested in is related with third party
> > > > applications like file managers, which are already exist for Android
> > > > platform, and the main goal to achieve is to find the way to start my
> > > > activity when specific file is selected to view with Action.VIEW
> > > > intent.
>
> > > > On 22 июл, 20:06, Dianne Hackborn <hack...@android.com> wrote:
> > > > > Look at the NotePad sample app.
>
> > > > > On Tue, Jul 21, 2009 at 12:29 AM, Dmitry Manayev
> > > > > <dmitry.mana...@gmail.com>wrote:
>
> > > > > > Sorry,could you tell me more about registering new MIME types in
> > > > > > Android.
> > > > > > Please add a code sample registering a new MIME type with specific
> > > > > > format.
>
> > > > > > On 21 июл, 01:01, Dianne Hackborn <hack...@android.com> wrote:
> > > > > > > It is automatically "registered" by virtue of being in your
> > manifest,
> > > > > > > insofar as when someone tries to launch an activity matching your
> > > > intent
> > > > > > > filter then your activity will be found.
>
> > > > > > > On Mon, Jul 20, 2009 at 1:43 PM, Dmitry Manayev <
> > > > > > dmitry.mana...@gmail.com>wrote:
>
> > > > > > > > Thanks for reply.
>
> > > > > > > > So if i registry this new MIME type,how and when it would be
> > added
> > > > to
> > > > > > > > Android?
> > > > > > > > //Comap is based on xml.
>
> > > > > > > > On 20 июл, 23:50, Dianne Hackborn <hack...@android.com> wrote:
> > > > > > > > > Android doesn't know anything about file extensions, only
> > MIME
> > > > types.
>
> > > > > > > > > On Mon, Jul 20, 2009 at 6:37 AM, Dmitry Manayev <
> > > > > > > > dmitry.mana...@gmail.com>wrote:
>
> > > > > > > > > > Hi!
>
> > > > > > > > > > I have problem with adding a new file type to android(the
> > file
> > > > > > type
> > > > > > > > > > is .comap).I need to run my application with this file from
> > > > android
> > > > > > > > > > browser and from file manager.
> > > > > > > > > > I know that I need to write a special <intent-filter> for
> > > > that,but
> > > > > > I
> > > > > > > > > > don't know how,because this format hasn't any
> > > > special,registered
> > > > > > MIME
> > > > > > > > > > type.
> > > > > > > > > > I tried to write in AndroidManifest.xml to open a file
> > > > test.comap:
> > > > > > > > > > <intent-filter>
> > > > > > > > > > <action
> > > > > > > > > > android:value="android.intent.action.VIEW" />
> > > > > > > > > > <category
> > > > > > > > > > android:value="android.intent.category.DEFAULT" />
> > > > > > > > > > <data android:scheme="file"
> > > > > > > > > > android:host="*" android:path="sdcard/test.comap" />
> > > > > > > > > > </intent-filter>
> > > > > > > > > > But this doesn't work.
> > > > > > > > > > How to do it right?
>
> > > > > > > > > --
> > > > > > > > > Dianne Hackborn
> > > > > > > > > Android framework engineer
> > > > > > > > > hack...@android.com
>
> > > > > > > > > Note: please don't send private questions to me, as I don't
> > have
> > > > time
> > > > > > to
> > > > > > > > > provide private support, and so won't reply to such e-mails.
> > All
> > > > > > such
> > > > > > > > > questions should be posted on public forums, where I and
> > others
> > > > can
> > > > > > see
> > > > > > > > and
> > > > > > > > > answer them.
>
> > > > > > > --
> > > > > > > Dianne Hackborn
> > > > > > > Android framework engineer
> > > > > > > hack...@android.com
>
> > > > > > > Note: please don't send private questions to me, as I don't have
> > time
> > > > to
> > > > > > > provide private support, and so won't reply to such e-mails. All
> > > > such
> > > > > > > questions should be posted on public forums, where I and others
> > can
> > > > see
> > > > > > and
> > > > > > > answer them.
>
> > > > > --
> > > > > Dianne Hackborn
> > > > > Android framework engineer
> > > > > hack...@android.com
>
> > > > > Note: please don't send private questions to me, as I don't have time
> > to
> > > > > provide private support, and so won't reply to such e-mails. All
> > such
> > > > > questions should be posted on public forums, where I and others can
> > see
> > > > and
> > > > > answer them.
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails. All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---