Im using LiveSDK for Onedrive sign in .it is working but shows warning on rotatating device on sign page and Authorization page.
Activilty has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@42acff18 that was originally added here......
code is follows
class SigninActivity extends Activity implements LiveAuthListener {
private LiveAuthClient signinauth;
public LiveConnectClient client;
private boolean signin = false;
public static final String[] SCOPES = {
"wl.signin",
"wl.basic",
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_in);
}
@Override
public void onResume() {
super.onResume();
if (this.signinauth == null) {
this.signinauth = new LiveAuthClient(this, LiveSdkContants.CLIENT_ID);
this.signinauth.login(this, Arrays.asList(SCOPES), this);
}
if (signin) {
System.out.println("Authorization Success");
finish();
}
}
public void onDestroy() {
super.onDestroy();
}
public void onAuthComplete(LiveStatus status, LiveConnectSession session, Object userState) {
if (status == LiveStatus.CONNECTED ) {
System.out.println("Connected");
signin = true;
client = new LiveConnectClient(session);
finish();
} else {
client = null;
signin = false;
finish();
}
}
public void onAuthError(LiveAuthException exception, Object userState) {
client = null;
System.out.println("Connection failed");
this.finish();
}
How I can solve this?
Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41d3cf88 that was originally added here at android.view.ViewRootImpl.(ViewRootImpl.java:402) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:311) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224) at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149) at android.view.Window$LocalWindowManager.addView(Window.java:554) at android.app.Dialog.show(Dialog.java:277) at com.microsoft.live.AuthorizationRequest.execute(AuthorizationRequest.java:344) at com.microsoft.live.LiveAuthClient.login(LiveAuthClient.java:504) at com.microsoft.live.LiveAuthClient.login(LiveAuthClient.java:427) at com.onedrive.SigninActivity.onResume(SigninActivity.java:303) at android.support.v4.app.Fragment.performResume(Fragment.java:1832) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:995) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1120) at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1939) at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:447) at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:436) at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:138) at android.app.Activity.performResume(Activity.java:5293) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2606) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2644) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2130) at android.app.ActivityThread.access$600(ActivityThread.java:140) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4898) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773) at dalvik.system.NativeStart.main(Native Method)