I need the set the Application attribute dynamically in android , particularly i need set the Name field which is shown below , i need to change it dynamically because i import two library packages each package will contain two different Application class to maintain session variable,but i can able to use any one Application class in impo开发者_StackOverflowrted project, i need to use that both dynamically based on the package user going to use, for that i need to set and change the Application class Name dynamically in Android Manifest.xml file.
if any one knows the solution means help me out.
Thanks.
Your manifest is within your apk, which is signed, so changing it dynamically would invalidate the whole package. My guess is dynamically changing the manifest is not possible.
I also agree Once your Apk is Created it contains your manifest file.And the manifest contains all information about the application,So it is not possible
We can't change manifest attribute dynamically
When an app installs, system first checks and collects the manifest file to get all the information about the app like permissions, activities, services, broadcast receivers, content providers.. etc, and based on that info the system reacts to the app in future.
For Example: if some app has request the system to perform some ACTION then the system knows that certain app has an activity that could deal with the ACTION, likewise if a boardcast is fired system knows which app has the related boardcast receivers to notify.. etc
However if we somehow able to edit the manifest file dynamically then also it will be of no use as the system will be unaware of those changes cause it reads the app's manifest file first time only while installing..
I agree with K-ballo ..I am not sure i got exactly what your problem is,but i worked on Android before and i am pretty sure that there is no way you are allowed to change the manifest dynamically.so its better if you find a new solution to deal with your problem :)
精彩评论