当前位置:网站首页>Use code to set activity to transparent
Use code to set activity to transparent
2022-07-23 21:34:00 【-SOLO-】
private void translucentActivity(Activity activity) {
try {
activity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
activity.getWindow().getDecorView().setBackground(null);
Method activityOptions = Activity.class.getDeclaredMethod("getActivityOptions");
activityOptions.setAccessible(true);
Object options = activityOptions.invoke(activity);
Class<?>[] classes = Activity.class.getDeclaredClasses();
Class<?> aClass = null;
for (Class clazz : classes) {
if (clazz.getSimpleName().contains("TranslucentConversionListener")) {
aClass = clazz;
}
}
Method method = Activity.class.getDeclaredMethod("convertToTranslucent",
aClass, ActivityOptions.class);
method.setAccessible(true);
method.invoke(activity, null, options);
} catch (Throwable t) {
t.printStackTrace();
}
}
边栏推荐
- SQLite数据库
- Synchro esp32c3 Hardware Configuration Information serial port Print Output
- Basic principle of synchronized lock
- Customer exit variable in query
- The common interfaces of Alipay are uniformly encapsulated and can be used directly for payment parameters (applicable to H5, PC, APP)
- googletest
- User manual of boost filesystem
- Summary of database stress testing methods
- High numbers | calculation of triple integral 2 | high numbers | handwritten notes
- query中的customer exit客户出口变量
猜你喜欢

SQLite database

Chapter 2 回归

Mysql database index

Network learning infrared module, 8-way emission independent control

Serveur de chat de Cluster: conception de la table de base de données

LeetCode_ 376_ Wobble sequence

MySql的DDL和DML和DQL的基本语法

Cluster chat server: how to solve the problem of cross server communication | redis publish subscribe
![[Yugong series] June 2022.Net architecture class 084- micro service topic ABP vNext micro service communication](/img/29/b73edbdb2409f40c904d126f9185d1.png)
[Yugong series] June 2022.Net architecture class 084- micro service topic ABP vNext micro service communication

The total ranking of blogs is 918
随机推荐
BroadCast(广播)
Chapter 2 回归
集群聊天服務器:數據庫錶的設計
Is it safe to open a mobile stock account?
[complex overloaded operator]
High numbers | calculation of triple integral 1 | high numbers | handwritten notes
Mysql database index
博客总排名为918
一道golang中关于for range常见坑的面试题
UnauthorizedAccessException:Access to the path “/xx/xx.xx“ is denied
Payment products and their usage scenarios
VLAN comprehensive experiment
Yushu A1 robot dog gesture control
The third slam Technology Forum - Professor wuyihong
LeetCode_ 376_ Wobble sequence
集群聊天服务器:集群与分布式理论
How to introduce your project experience in the interview
如何在面試中介紹自己的項目經驗
TCP half connection queue and full connection queue (the most complete in History)
比较关注证券公司究竟哪个佣金最低?请问网上开户安全么?