Given the information I met finishing

1.NoSuchMethodError: No virtual method getBytes(J)[B in class Lcom/huawei/kvdb/KVConnection; or its super classes (declaration of 'com.huawei.kvdb.KVConnection' appears in /system/framework/hwframework.jar)

solve
To get rid of testing the legality of PNG, in build.gradle in the following two sentences buildToolsVersion add the following:
buildTypes {
release {
minifyEnabled false

aaptOptions.setProperty("cruncherEnabled",false)
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'

}
}

  

2.Unable to add window -- token android.os.BinderProxy@adbfbf8 for displayid = 0 is not valid; is your activity running?
1、错误分析:

From the error message we can understand its causes, the root cause of this problem is due to the pop-up dialog will be attached to the View does not exist due.

2, according to what may be the problem: When the screen pops up and then destroyed; our view is changed or when the interface jump, dialog dependence of context changes or interface is not running.

In addition, many times we need to call the method of a view through a non-component class to class or pop-up dialog Toast, so you need to provide a static context to create the dialog or Toast. For example, we pass in a view of a static class to pop up a dialog box: AlertDialog.Builder builder = new AlertDialog.Builder (mContextNew); static context is of course not all can be used to create dialog, such as *???? ** App (). getApplication (). getApplicationContext () will not work in this context, because it does not represent what an Activity or View. . So you can not add this dialog.

This view displays the data used to bind us in its constructor to initialize a static mContextNew mContext To this end view of variables. So that we can pass a static class to bring up a dialog box, simply pass this static context (mContextNew) on it. . But only if the static context initialization in the constructor, then there will be a problem, because if the other from an interface bind data view with this view is that this static context will be re-modified. . So when this new interface to return to finish the last interface, this is just a static context already finish of view of context. So if this is still passing through a static variable static class can not find the above error to bring up the dialog box will appear in the window.
Solution:

if(!((Activity) context).isFinishing())
{
    //show dialog
}

  

Guess you like

Origin www.cnblogs.com/wang-jingyuan/p/12174660.html