Reputation: 37
With my program I launch a activity that show a fake alertdialog for battery low. Now I want change also the icon battery on status bar but this is a system icon and there is not api for to do this. I found on the Internet this not public API http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/com/android/server/status/StatusBarIcon.java but I have a problem for this line :
1) View v = inflater.inflate(com.android.internal.R.layout.status_bar_icon, parent, false);
2) AnimatedImageView im = (AnimatedImageView)v.findViewById(com.android.internal.R.id.image);
because on official API there is not a com.android.internal.R.layout.status_bar_icon or com.android.internal.R.id.image I tried to replace with costant int value but for first line I get View v = com.android.server.status.statusbarview@44f0a2c0 but for second line I get AnimatedImageView im = null :-(
How can I do it?
I can not do it, I thought of creating a transparent activity in fullscreen modo and notitle and put my fake battery image on the top and with layout margin left put it over the battery icon. I tried it but my image go under the status bar...why ?? :-(
Upvotes: 1
Views: 1855
Reputation: 33509
Mimmo,
As far as I know, the only way to change the battery icon in the status bar would be a custom ROM. I don't believe it can be done programmatically, even with root access.
Upvotes: 3