Android 相当于 iPhone 的默认图像

发布于 2024-11-13 08:38:27 字数 150 浏览 3 评论 0原文

是否可以在启动应用程序时设置默认图像?在 iPhone 上,我可以设置一个名为“Default.png”的图像来执行此操作。但在安卓上可以吗?

(有关信息,我之所以这么问,是因为由于第一个活动中的视频视图,我无法对其他活动使用 splascreen 视图或自动活动。)

Is it possible to set a default image during starting an application? On iPhone, I can set an image named "Default.png" to do that. But is it possible on Android?

(For information I ask that because I can't use a splascreen view or auto-activity to an other, because of videoview in the first activity.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

记忆里有你的影子 2024-11-20 08:38:27

我不明白为什么不使用splashscreen

public class SplashScreenActivity extends Activity {
    protected boolean _active = true;
    private Thread splashTread;
    protected int _splashTime = 2000; // time to display the splash screen in ms

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        // thread for displaying the SplashScreen
        final SplashScreenActivity sPlashScreen = this;
        // thread for displaying the SplashScreen
        splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    synchronized (this) {
                        // wait 5 sec
                        wait(_splashTime);
                    }
                } catch (InterruptedException e) {

                } catch (UnsupportedOperationException e1) {
                    // TODO: handle exception
                } finally {
                    finish();
                    // start a new activity
                    Intent i = new Intent();
                    i.setClass(sPlashScreen, Your videoViewActivity.class);
                    startActivity(i);
                }
            }
        };
        splashTread.start();
    }

    // Function that will handle the touch
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            synchronized (splashTread) {
                splashTread.notifyAll();
            }
        }
        return true;
    }
}

I dont understand a reason why not to use splashscrean

public class SplashScreenActivity extends Activity {
    protected boolean _active = true;
    private Thread splashTread;
    protected int _splashTime = 2000; // time to display the splash screen in ms

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        // thread for displaying the SplashScreen
        final SplashScreenActivity sPlashScreen = this;
        // thread for displaying the SplashScreen
        splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    synchronized (this) {
                        // wait 5 sec
                        wait(_splashTime);
                    }
                } catch (InterruptedException e) {

                } catch (UnsupportedOperationException e1) {
                    // TODO: handle exception
                } finally {
                    finish();
                    // start a new activity
                    Intent i = new Intent();
                    i.setClass(sPlashScreen, Your videoViewActivity.class);
                    startActivity(i);
                }
            }
        };
        splashTread.start();
    }

    // Function that will handle the touch
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            synchronized (splashTread) {
                splashTread.notifyAll();
            }
        }
        return true;
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文