I am making an dictionary for android phones and tablets. I have committed the file on my developer account, and i works like a charm on phone. When i am trying to run the exact
I simply added a few lines of code to the com.google.android.vending.expansion.downloader.impl .V11CustomNotification class:
public class V11CustomNotification implements DownloadNotification.ICustomNotification {
// ...
boolean hasSetProgressFunction = false; // Added
boolean hasCheckedForSetProgressFunction = false; // Added
public void CheckForFunction() { // Added
try {
final Class> notificationBuilderClass = Class.forName("android.app.Notification$Builder");
notificationBuilderClass.getDeclaredMethod("setProgress", new Class[] {Integer.TYPE, Integer.TYPE, Boolean.TYPE});
this.hasSetProgressFunction = true;
} catch (final Exception e) {
this.hasSetProgressFunction = false;
}
this.hasCheckedForSetProgressFunction = true;
}
// ...
@Override
public Notification updateNotification(Context c) {
if(!this.hasCheckedForSetProgressFunction) { // Added
this.CheckForFunction(); // Added
} // Added
// ...
builder.setContentTitle(mTitle);
if(this.hasSetProgressFunction) { // Added
if ( mTotalKB > 0 && -1 != mCurrentKB ) {
builder.setProgress((int)(mTotalKB>>8), (int)(mCurrentKB>>8), false);
} else {
builder.setProgress(0,0,true);
}
} // Added
// ...
}
}
It's the answer from "android developer" used in a different way ;)