public String decompress(byte[] compressed) throws IOException {
final int BUFFER_SIZE = 32;
ByteArrayInputStream is = new ByteArrayInputStream(compressed);
GZIPInputStream gis = new GZIPInputStream(is, BUFFER_SIZE);
StringBuilder string = new StringBuilder();
byte[] data = new byte[BUFFER_SIZE];
int bytesRead;
while ((bytesRead = gis.read(data)) != -1) {
string.append(new String(data, 0, bytesRead));
}
gis.close();
is.close();
return string.toString();
}
// 解压
String cc = "H4sIAAAAAAAAA3s6ddlTVAQAXAODIhIAAAA=";
try {
this.decryptedText.setText(this.decompress(Base64.decode(cc.toCharArray())));
} catch (IOException e) {
e.printStackTrace();
}
分类目录归档:android
E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED
Using an emulator WITHOUT Google Play will cause this error.
使用没有Google Play的模拟器会导致此错误。
更新包不兼容 需卸载后重装 解决办法实测有效
开调试模式,用包名卸载
列出所有应用
adb shell pm list package
卸载包
adb uninstall com.xxx.xxx
scrollView.setOnScrollChangeListener
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() { @Override public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { Log.i("iTag.scrollY", String.valueOf(scrollY)); Log.i("iTag.oldScrollY", String.valueOf(oldScrollY)); if (scrollY < 0 && oldScrollY < 0) { textView.setText(""); doGet(); } } }); }
android去除标题栏
跟踪
android:theme="@style/AppTheme"
进入修改style.xml文件,这里还可以修改颜色,还可以全屏
<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> <!-- Customize your theme here. --> <!--<item name="colorPrimary">@color/colorPrimary</item>--> <!--<item name="colorPrimaryDark">@color/colorPrimaryDark</item>--> <!--<item name="colorAccent">@color/colorAccent</item>--> <item name="android:windowFullscreen">true</item> </style> </resources>