Android annotations problems accessing TextView from another class
<p>I recently started using android annotations and I am trying to set text to various TextViews from within a class (MyService).</p>

<p>Unfortunately the app crashes with a nullpointerexception when I am trying to set the text. </p>

<p>I already looked at the annotations (<a href="https://github.com/androidannotations/androidannotations/wiki/Injecting-Views" rel="nofollow noreferrer">documentation</a>) and <strong>searched on stackoverflow</strong> for identical problems but I am unable to find the correct way in this.</p>

<p><em>If someone could help me in doing this the right way, I would be gratefull.</em></p>

<p>Please be gentle with downvotes as I am trying to learn annotations.</p>

<p>The class (<strong>DownloadsDialog</strong>) where the TextViews are intiated through (<strong>@ViewById</strong>):</p>

<pre><code>@EFragment(R.layout.downloads_dialog)
public class DownloadsDialog extends BaseDialog implements LoaderManager.LoaderCallbacks&lt;BaseResponse&gt; {
..
@ViewById(R.id.statusTxt)
    TextView mStatusTxt;

@ViewById(R.id.sizeTxt)
    TextView mSizeTxt;

@ViewById(R.id.progress1)
    ProgressBar mProgress;
..
}
</code></pre>

<p>And this is the class (<strong>MyService</strong>) from which I am trying to <strong>set text</strong> to these TextViews:</p>

<pre><code>public class MyService extends IntentService {
..
public MyService() {
        super("MyService");
    }
..

class MyDownloadDownloadStatusListenerV1 implements DownloadStatusListenerV1 {

        @Override
        public void onDownloadComplete(DownloadRequest request) {
            final int id = request.getDownloadId();
            if (id == downloadId1) {
                // How to access TextView in DownloadsDialog?                    
            mStatusTxt.setText("Status: completed");                     

            Log.e("TAG", "download completed");
            }
        }
..
}
</code></pre>