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 sagi · May 22, 2013 at 12:12 PM · androidpluginblackactivitytranslucent

android: why scene goes black when showing new activity?

Hi, I am developing a plugin that allows showing a new activity on top of the existing unity activity. The new activity is a standard android activity (does not derive from unity activity, etc). The new activity is also not full screen, i.e. it is supposed to have a transparent background (showing the underlying unity scene) with a portion of the display showing some popup UI. When I run the activity code in a native android app, all is fine, I can see the underlying activity. But when I run it inside a unity app (wrapped by a plugin), the new activity popup UI shows up with black background - the underlying unity scene/activity does not show.

here is the activity definition in the manifest, as you can see it has the usual Translucent values, etc:

 <activity android:configChanges="orientation|keyboardHidden" android:name="com.mycomp.MyActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
 

any ideas why I don't see the background?

Comment
Add comment · Show 3
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
avatar image gewenpeng · Aug 13, 2013 at 03:50 AM 0
Share

I have same question, are you solution?

avatar image sagi · Aug 13, 2013 at 01:20 PM 0
Share

no answer yet :(

avatar image El Tun · Sep 26, 2014 at 02:51 AM 0
Share

Did u have any solutions? :(

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Jamora · Aug 13, 2013 at 08:22 PM

You could try to have [Application.runInBackground][1] = true; set in an Awake or Start method somewhere. It defaults to false and as such pauses the Unity application when it looses focus.

[1]: http://docs.unity3d.com/Documentation/ScriptReference/Application-runInBackground.html

Comment
Add comment · Show 1 · Share
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
avatar image gewenpeng · Aug 15, 2013 at 04:24 AM 0
Share

thx you answer! I try your method, but my question don't solution!

avatar image
0

Answer by yx.xiong · Oct 16, 2013 at 07:22 AM

Write your custom UnityProxyActivity,UnityPlayerActivity,and UnityPlayerNativeActivity 125https://developer.vuforia.com/resources/dev-guide/extending-unity-activities125, then override onPause and onResume like this:

       if (myKeepRunning) {
         try {
             Class superSuperClass = this.getClass().getSuperclass()
                     .getSuperclass().getSuperclass();
             Field field = null;

             field = superSuperClass.getDeclaredField("mCalled");
             // set accessible true
             field.setAccessible(true);
             field.set(this, true);

             Log.v("MyUnityPlayerNativeActivity", "Value of privateKey: "
                     + field.get(this));
         } catch (Exception e) {
             super.onPause();
         }
     } else {
         super.onPause();
     }


Comment
Add comment · Share
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
avatar image
0

Answer by izowooi · Sep 30, 2014 at 01:54 AM

Try change the MainActivity. There are three Native java class in Unity3d. I changed my MainActivity. Then I solved it.

Comment
Add comment · Share
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

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

20 People are following this question.

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

Related Questions

show Alertdialog in android 0 Answers

How can I replace correctly the main activity on the Android Manifest? 0 Answers

Android - Touch input won't work, Invisible activity in front of Unity activity 0 Answers

Android plugin & Activity help needed - "GetMethodID method not found" problems 0 Answers

How to open transparent activity from UnityPlayerActivity? 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