Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Jessespike · Aug 29, 2012 at 07:28 PM · androidcrashlogcatactivity

Restarting UnityPlayer inside of Android activity

I been trying my best to minimize a random hanging on scene loads. I have followed the mobile optimization page and have reduced memory significantly. But after a few scene loads, Unity will still hang. Logcat spams "Inflate error: ...". (Heap overflow?) Basically from here, Unity gets stuck loading the next scene until after a few minutes or so, then the activity gets timed out / dropped.

I been trying to handle the hanging, normally a scene takes less than 10 seconds to load. If the load gets stuck and persists for 30 seconds, I instruct Unity to call it's android activity. Which I am able to do, and currently I am simply instructing UnityPlayer and the activity to shutdown. But that's not what I want to do, I want to restart the UnityPlayer in the activity without actually re-launching the app from the OS.

I don't have much Android experience, but I do realize that traditionally in Android applications, the developer is expected to handle gl-context recreations and such, (reloading textures etc). But UnityPlayer seems to work differently. Mind you, this problem only exists in Android 2.3.x, if I use Android 4.x, everything is OK. I'm currently experimenting with onSaveInstanceState and other activity methods, but I haven't had much luck yet.

.

TLDR; Unity sometimes hangs while loading a scene, I can call activity methods from Unity. I want the activity to recreate the UnityPlayer. I want UnityPlayer to restart without the need to actually quit the activity and re-launching from the OS.

Link to forum thread: http://forum.unity3d.com/threads/149299-Restarting-UnityPlayer-inside-of-Android-activity

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to get Native Activity of Unity in Android NDK? 2 Answers

unity main crash 0 Answers

My android game is crashing on stock nexus 4 running Android 5.1.1 . My unity versioin 4.6.7p2 ? Its running on other android devices.I've attached logcat.But i don't understand it.Need urgent help 1 Answer

Game crash after splash screen (Unity Logo showup-than crash) 1 Answer

White screen freeze and crash on Android 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges