Start a new Activity and get its result, through a non Activity class
<p>Usually, in order to launch a new Activity and get its result, from an Activity class, I will use</p>

<p><em><strong><a href="http://developer.android.com/reference/android/app/Activity.html#startActivityForResult%28android.content.Intent,%20int%29" rel="nofollow">public void startActivityForResult (Intent intent, int requestCode)</a></em></strong></p>

<p>However, what if I try to launch a new Activity and get its result, from a non-Activity class? How I can achieve this?</p>

<p>The reason I ask so as I am currently having <code>LoginManager</code> class (A non-Activity class). It is having the following code.</p>

<pre><code>    accountManager.getAccountManager().getAuthToken(account, AUTH_TOKEN_TYPE, true, new AccountManagerCallback&lt;Bundle&gt;() {
        public void run(AccountManagerFuture&lt;Bundle&gt; future) {
            try {
                Bundle bundle = future.getResult();
                if (bundle.containsKey(AccountManager.KEY_INTENT)) {
                    Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT);
                    intent.setFlags(intent.getFlags() &amp; ~Intent.FLAG_ACTIVITY_NEW_TASK);
                    // Compilation error, as LoginManager doesn't have startActivityForResult method.
                    startActivityForResult(intent, REQUEST_AUTHENTICATE);
</code></pre>
