Set application as default in android -
how can set app default. have create 1 application contain the qr code scanner functionality, have used zxing library project qr code scanner. working file, when run project suffer "complete action using" option. when click on application scanner button open device photographic camera before inquire option. want application default qr scanner. means won't appear complete action using option.
so how can this?
use intent filters in manifest specify actions activity handles below:
<activity class=".noteeditor" android:label="@string/title_note"> <intent-filter android:label="@string/resolve_edit"> <action android:name="android.intent.action.view" /> <action android:name="android.intent.action.edit" /> <category android:name="android.intent.category.default" /> <data android:mimetype="vnd.android.cursor.item/vnd.google.note" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.insert" /> <category android:name="android.intent.category.default" /> <data android:mimetype="vnd.android.cursor.dir/vnd.google.note" /> </intent-filter> </activity> for instance action name reading qr codes maybe android.intent.readqr specify action in intent filter, telling android app handles action. when right, app should appear in list.
take @ link:
http://developer.android.com/reference/android/content/intent.html
edit: check link setting app default:
http://droidyue.com/blog/2014/01/12/set-the-preferred-application-in-android/
android android-intent
No comments:
Post a Comment