Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android - How to programmatically read manifest intents?

I'm trying to make a piece of code that will work across multiple apps. I can't figure out how to read this from within Java, though. Is it possible without parsing the manifest manually? I want to grab scheme1 and scheme2 out with a few lines of code.

<activity android:name="urlHandlingBlah">
    <intent-filter>
        <action android:name="android.intent.action.VIEW"></action>
        <category android:name="android.intent.category.DEFAULT"></category>
        <category android:name="android.intent.category.BROWSABLE"></category>
        <data android:scheme="scheme1"></data>
        <data android:scheme="scheme2"></data>
    </intent-filter>
</activity>

Edit: I mean how would I use PackageManager to grab this info. I don't care about the actual XML, per se.

like image 346
xtravar Avatar asked Jan 18 '13 08:01

xtravar


1 Answers

No, this is not possible because once your app has been created everything gets converted to an APK, and that manifest is no longer readable at runtime. You can however read these properties interacting with the PackageManager though.

like image 123
JoxTraex Avatar answered Nov 10 '22 00:11

JoxTraex