Home > Mobile >  StartActivity activity could not be started
StartActivity activity could not be started

Time:10-13

Recently found a code, test is passed, before the recent on beautiful MIUI system failure, tried all sorts of boot method are not, hope one can show just a little;
Requirements:
Used in the Activity A startActivity to start the Activity B;
No problem, when APP in the foreground can be normal tuned up B; But by pressing the home button, hidden until after the background, will not be able to adjust the B
In vivo, huawei mobile phone is normal, can normal tuning up B; On the beautiful miui system not
The GIF below are in vivo effect on the cell phone;


Tuned up code:
 
Public static void startActivity (Context CXT, String dialInfo, String roomId) {
Bundle Bundle=getBaseBundle (dialInfo);
Bundle. PutString (ImConstants. Bundle. CHAT_ID, roomId);

Intent Intent=new Intent (CXT, biggest lass);
Intent. SetFlags (intent. FLAG_ACTIVITY_NEW_TASK | intent. FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
Intent. PutExtras (bundle);
CXT. StartActivity (intent);
}


Who have relevant solutions, and solve

CodePudding user response:

Hurry, online, etc., this question is too strange, as if only beautiful miui will have

CodePudding user response:

What the error is, as far as I know more than 8.0 system limits the background to start the activity

CodePudding user response:

reference m - 2 floor oj response:
what the error is, as far as I know more than 8.0 system limits the background to start the activity

There is no error, the code all gone, but no callback interface

CodePudding user response:

reference uu00soldier reply: 3/f
Quote: refer to the second floor m - oj response:

What the error is, as far as I know more than 8.0 system limits the background to start the activity

No error code all gone, just adjust the interface

Are you the context of the Application? Try to use the Application to start your activity

CodePudding user response:

m - reference 4 floor oj response:
Quote: refer to the third floor uu00soldier response:

Quote: refer to the second floor m - oj response:

What the error is, as far as I know more than 8.0 system limits the background to start the activity

No error code all gone, just adjust the interface

Are you the context of the Application? Try the Application to start your activity


You mean like this? CXT. GetApplicationContext (.) startActivity (intent);

No oh

CodePudding user response:

The activity you have retreated to the background, but also start to jump the original logic is not ah, must have a lot of problems appear, unless do WeChat that strong, and WeChat I sometimes fall out call interface

CodePudding user response:

reference 5 floor uu00soldier reply:
Quote: refer to 4th floor m - oj response:

Quote: refer to the third floor uu00soldier response:

Quote: refer to the second floor m - oj response:

What the error is, as far as I know more than 8.0 system limits the background to start the activity

No error code all gone, just adjust the interface

Are you the context of the Application? Try the Application to start your activity


You mean like this? CXT. GetApplicationContext (.) startActivity (intent);

No

There seems to be on the top of the stack is the activity, you try to this activity sets a activityaffinity,

CodePudding user response:

reference building 7 m - oj response:
Quote: refer to the fifth floor uu00soldier reply:

Quote: refer to 4th floor m - oj response:

Quote: refer to the third floor uu00soldier response:

Quote: refer to the second floor m - oj response:

What the error is, as far as I know more than 8.0 system limits the background to start the activity

No error code all gone, just adjust the interface

Are you the context of the Application? Try the Application to start your activity


You mean like this? CXT. GetApplicationContext (.) startActivity (intent);

No

There seems to be on the top of the stack is the activity, you try to this activity sets a activityaffinity


What you said is set in the manifest the taskAffinity attribute values?

Tested the next

CodePudding user response:

Millet phone added background launch permissions, is off by default, you can see if there is a corresponding API, or determine if it is MIUIx (don't know is a few to start) will prompt the user to open the background to start the permissions (app permissions inside finally have the permission) "the background pop-up interface"

CodePudding user response:

I also saw this, it is a beautiful MIUI system permissions, is not native, is currently not found related can detect, to apply for permission API, which chest brother know, please leave a message!
Beautiful MIUI announcement: [developer] about off by default "popup page background" permission notice;


I directly around the past, the telephone customer service, no API, there is no white list, developers do not have any means to prompt the user; I was drunk!
  • Related