How to launch my app if some one browses any xml file

by Dianne Hackborn » Thu, 18 Jun 2009 16:39:29 GMT


Sponsored Links
 I don't think you can do this because the initial URL interception happens
when the browser is processing the URI, before it has a MIME type.  If it
doesn't find an external activity to handle the raw URI, it will at that
point see if it can handle it internally.  At that point either it will do
so, or only if it can't handle it internally will it start retrieving it (at
which point it finds out its MIME type) and if there is an activity that
contains that MIME type it will hand it off.






-- 
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.

--~--~---------~--~----~------------~-------~--~----~



How to launch my app if some one browses any xml file

by Sujay Krishna Suresh » Thu, 24 Sep 2009 20:34:29 GMT


 


I think wat u r speakin abt is wat a plugin can do.
I'm not sure if plugin development is even possible for android's browser.
But wat u can try is have an intent-filer in your manifest consisting of
action ACTION_VIEW and content-type application/xml.
But 'm not very sure tat it'd work.
U could chk its workin by using a file-browser(like the OI file manager)
app, trying to view a xml/rss file stored in ur phone/sdcard.



-- 
Regards,
Sujay
Jonathan Swift< http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> ;
- "May you live every day of your life."

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Database handling - when do you open and close

onResume / onPause are called when another activity pops in front, but 
your activity stays on the screen. So this is probably a bit much.


You could try onStart / onStop, and move the code that populates views with database data from onCreate to onStart. -- Kostya 15.07.2010 18:49, Bender :
Thanks for your reply. I tried to open the db only in onResume() but that doesn't work since there are db accesses in the onCreate() method which is called before onResume() as far as I know. I think opening and closing the db after every access would slow the app down a lot because i'm using the db in almost every method. I hope there is another solution for it..
Probably by opening the db both in onCreate() and onResume() in some circustances (e.g. first execution of your app) the db will be opened twice, which for sure is not good. If you open the db only in onResume() it should be fine (although I didn't try it by myself). Usually, when I need data from the db, I call db.open(), fetch my data, and db.close(). In this way I'm pretty sure there won't be any such leak. Still I don't know if that's "the best way" to do it. YuviDroid
Hi,
I'm writing an app which has 2 activities and gets his data from a database. Unfortunately I'm not sure when I have to open and close the database properly. In both activities I'm opening the database so the activities can access its data. When I do the following:
* Start the app * Open activity 1 * Open activity 2 (via button in activity 1) * Hit the back button (back to activity 1) * Again back button (back to home screen) * Start the app
I'm receiving such an leak error:
07-15 14:34:19.504: ERROR/Database(234): Leak found 07-15 14:34:19.504: ERROR/Database(234): java.lang.IllegalStateException: mPrograms size 1 07-15 14:34:19.504: ERROR/Database(234): at android.database.sqlite.SQLiteDatabase.finalize(SQLiteDatabase.java: 1669) 07-15 14:34:19.504: ERROR/Database(234): at dalvik.system.NativeStart.run(Native Method) 07-15 14:34:19.504: ERROR/Database(234): Caused by: java.lang.IllegalStateException: /data/data/de.anote/databases/ anote.db SQLiteDatabase created and never closed
.... more stuff .....
I guess it is because I'm not closing the database so implemented the following:
* db.open() in both onCreate() and both onResume() methods by the 2 activities * db.close() in both onPause() methods.
But now I'm receiving another error:
07-15 15:27:18.472: ERROR/AndroidRuntime(266): Uncaught handler: thread main exiting due to uncaught exception 07-15 15:27:18.508: ERROR/AndroidRuntime(266): java.lang.RuntimeException: Unable to resume activity {de.anote/ de.anote.gui.CategoryView}: java.lang.IllegalStateException: mQuery SELECT _id, note_name, value, date, category, priority, reminderbool, reminder, todo FROM t_note WHERE category=? ORDER BY date 1 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.app.ActivityThread.performResumeActivity(ActivityThread.java: 2950) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java: 2965) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1889) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.os.Handler.dispatchMessage(Handler.java:99) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.os.Looper.loop(Looper.java:123) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.app.ActivityThread.main(ActivityThread.java:4363) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at java.lang.reflect.Method.invokeNative(Native Method) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at java.lang.reflect.Method.invoke(Method.java:521) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at dalvik.system.NativeStart.main(Native Method) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): Caused by: java.lang.IllegalStateException: mQuery SELECT _id, note_name, value, date, category, priority, reminderbool, reminder, todo FROM t_note WHERE category=? ORDER BY date 1 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.database.sqlite.SQLiteQuery.requery(SQLiteQuery.java:162) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.database.sqlite.SQLiteCursor.requery(SQLiteCursor.java:536) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.app.Activity.performRestart(Activity.java:3736) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.app.Activity.performResume(Activity.java:3756) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.app.ActivityThread.performResumeActivity(ActivityThread.java: 2937) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): ... 10 more 07-15 15:27:18.508: ERROR/AndroidRuntime(266): Caused by: android.database.sqlite.SQLiteMisuseException: library routine called out of sequence: handle 0x0 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.database.sqlite.SQLiteProgram.native_bind_string(Native Method) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java: 178) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): at android.database.sqlite.SQLiteQuery.requery(SQLiteQuery.java:153) 07-15 15:27:18.508: ERROR/AndroidRuntime(266): ... 14 more
Unfortunately I can't read which line in my code causes this exception but I guess it is because there is some point where is a database access and the db is still closed.
So my question is, at which places should I open and close my database? It is right to open it in the onCreate(), onResume() methods and close it in onPause()?
--

2. Power Consumption and SQLite

Hi there,

does SQLite have any big impact on power consumption? I am just
thinking about storing data in a List or Map or in a database. I have
a lot of inserts and queries, several a second. Any ideas on this?

Best
mb

-- 

3. better keyboard

4. UPnP C Library

5. ] Motorola Milestone XT720 2nd dan Galaxy Bea

6. Not able to set APN with 2G network, but works with 3G

7. Problem in SimpleDateFormat MMM return month number