1***@qq.com
1***@qq.com
  • 发布:2025-11-21 10:34
  • 更新:2025-11-21 10:34
  • 阅读:19

【报Bug】 UniPlugin-Hello-AS 项目中 我想自定义splash activity,但是怎么也越过不了自带的启动页

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: macOS sequoia 15.6.1

HBuilderX类型: 正式

HBuilderX版本号: 4.64

手机系统: 全部

手机厂商: 华为

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

测试过的手机:

hormonyos 4.2.0

示例代码:

public class SplashActivity extends AppCompatActivity {

private WebView webView;  
@Override  
protected void onCreate(Bundle savedInstanceState) {  
    super.onCreate(savedInstanceState);  
    EdgeToEdge.enable(this);  
    setContentView(R.layout.activity_splash);  
    new Handler().postDelayed(new Runnable() {  
        @Override  
        public void run() {  
            FilePicker.sendMessageToUniApp("dsadsah");  

            Intent intent = new Intent(SplashActivity.this, PandoraEntry.class); // 替换为你的主Activity类名  
            startActivity(intent);  

            finish(); // 关闭SplashActivity  
        }  
    }, 1000); // 延迟3秒跳转,单位是毫秒  

// ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
// Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
// v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
// return insets;
// });
}
app/androidManifest
<activity
android:name=".activity.SplashActivity"
android:exported="true"
android:theme="@style/ThemeSplash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name="io.dcloud.PandoraEntry"
android:configChanges="orientation|keyboardHidden|screenSize|mcc|mnc|fontScale"
android:exported="true"
android:hardwareAccelerated="true"
android:theme="@style/TranslucentTheme"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />  
            <category android:name="android.intent.category.BROWSABLE" />  

            <data android:scheme="hbuilder" />  
        </intent-filter>  
        <intent-filter>  
            <action android:name="android.intent.action.SEND" />  

            <category android:name="android.intent.category.DEFAULT" />  

            <data android:mimeType="image/*" />  
        </intent-filter>  

    </activity>  

uniapp中mainfest.json
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},

操作步骤:

将uniapp项目生成本地打包app资源,倒入离线工程UniPlugin-Hello-AS ,进行运行

预期结果:

想使用自带的splashactivity,跳过系统的启动页

实际结果:

我自定义的启动页显示一遍,自带的启动页显示一遍,显示了2次启动页

bug描述:

UniPlugin-Hello-AS 项目中 我想自定义splash activity,但是怎么也越过不了自带的启动页

2025-11-21 10:34 负责人:无 分享
已邀请:

要回复问题请先登录注册