@@ -0,0 +1,1375 @@
+package cc.cubone.turbo.core.app;%0A%0Aimport android.os.Bundle;%0Aimport android.support.v7.app.AppCompatActivity;%0A%0Apublic class TokenActivity extends AppCompatActivity %7B%0A%0A    private boolean mAttached;%0A%0A    /*public boolean isAttached() %7B%0A        return mAttached;%0A    %7D*/%0A%0A    @Override%0A    protected void onResume() %7B%0A        super.onResume();%0A        tryResumeUnderAttached();%0A    %7D%0A%0A    /**%0A     * To avoid %7B@link android.view.WindowManager.BadTokenException%7D, should show%0A     * %7B@link android.widget.PopupWindow%7D, %7B@link android.app.Dialog%7D in this method.%0A     * Must not show them in %7B@link #onCreate(Bundle)%7D, %7B@link #onResume()%7D directly.%0A     *%0A     * %3Cp%3EIt is also recommended that register the %7B@link android.content.BroadcastReceiver%7D%0A     * in this method and unregister it in %7B@link #onDetachedFromWindow()%7D.%0A     */%0A    @Override%0A    public void onAttachedToWindow() %7B%0A        super.onAttachedToWindow();%0A        mAttached = true;%0A        tryResumeUnderAttached();%0A    %7D%0A%0A    @Override%0A    public void onDetachedFromWindow() %7B%0A        super.onDetachedFromWindow();%0A        mAttached = false;%0A    %7D%0A%0A    private void tryResumeUnderAttached() %7B%0A        if (mAttached) %7B%0A            onResumeUnderAttached();%0A        %7D%0A    %7D%0A%0A    /**%0A     * Ensure %7B@link #onResume()%7D under the window has been attached.%0A     */%0A    protected void onResumeUnderAttached() %7B%0A    %7D%0A%0A%7D%0A

add token activity